You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/manual.txt
+31-9
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@
9
9
The Nikola Handbook
10
10
===================
11
11
12
-
:Version: 7.7.5
12
+
:Version: 7.7.6
13
13
14
14
.. class:: alert alert-info pull-right
15
15
@@ -813,28 +813,49 @@ To use them from plugins, please see `Extending Nikola <https://getnikola.com/ex
813
813
Using a shortcode
814
814
~~~~~~~~~~~~~~~~~
815
815
816
-
In your content files, a shortcode can be called by using the ``{{% name parameters %}}`` form. Shortcode parameters are space delimited. Parameters with spaces can be quoted (or backslash escaped).
816
+
In your content files, a shortcode can be called by using the {{% raw %}}{{% name parameters %}}{{% /raw %}} form. Shortcode parameters are space delimited. Parameters with spaces can be quoted (or backslash escaped).
817
817
818
818
The first word is always the name of the shortcode. Parameters follow the name. Depending upon how the shortcode is defined, the parameters may be named, positional or both. The format for named parameters models that of HTML with the format name="value".
819
819
820
820
Some shortcodes use or require closing shortcodes. Like HTML, the opening and closing shortcodes match (name only), the closing being prepended with a slash.
821
821
822
822
Example of a paired shortcode (note that we don't have a highlight shortcode yet ;-)::
823
823
824
-
{{% highlight python %}} A bunch of code here {{% /highlight %}}
825
-
824
+
{{% raw %}}{{% highlight python %}} A bunch of code here {{% /highlight %}}{{% /raw %}}
825
+
826
826
Built-in shortcodes
827
827
~~~~~~~~~~~~~~~~~~~
828
828
829
829
post-list
830
830
Will show a list of posts, see the `Post List directive for details <#post-list>`__
831
-
831
+
832
+
media
833
+
Display media embedded from a URL, for example, this will embed a youtube video::
834
+
835
+
{{% raw %}}{{% media url="https://www.youtube.com/watch?v=Nck6BZga7TQ" %}}{{% /raw %}}
836
+
837
+
In reStructuredText this shortcode will fail because docutils turns that URL to a link and everything breaks, use the `media directive <#media>`__ instead.
838
+
839
+
chart
840
+
Create charts via PyGal. This is similar to the `chart directive <#chart>`__ except the syntax is adapted to
841
+
shortcodes. This is an example::
842
+
843
+
{{% raw %}}{{% chart Bar title='Browser usage evolution (in %)' %}}
0 commit comments