diff --git a/docs/content/extras/shortcodes.md b/docs/content/extras/shortcodes.md index c2c075ea1..5e2d2da87 100644 --- a/docs/content/extras/shortcodes.md +++ b/docs/content/extras/shortcodes.md @@ -35,16 +35,32 @@ can be quoted). The first word is always the name of the shortcode. Parameters follow the name. The format for named parameters models that of HTML with the format -`name="value"`. The current implementation only supports this exact format. Extra -spaces or different quotation marks will not parse properly. +`name="value"`. Some shortcodes use or require closing shortcodes. Like HTML, the opening and closing shortcodes match (name only), the closing being prepended with a slash. Example of a paired shortcode: - {{%/* highlight go */%}} A bunch of code here {{%/* /highlight */%}} + {{* highlight go */>}} A bunch of code here {{* /highlight */>}} +The examples above use two different delimiters, the difference being the `%` and the `<` character: + +### Shortcodes with Markdown + +The `%` characters indicates that the shortcode's inner content needs further processing by the page's rendering processor (i.e. Markdown), needed to get the **bold** text in the example below: + + ``` +{{%/* myshortcode */%}}Hello **World!**{{%/* /myshortcode */%}} +``` + +### Shortcodes without Markdown + +The `<` character indicates that the shortcode's inner content doesn't need any further rendering, this will typically be pure HTML: + + ``` +{{* myshortcode */>}}
Hello World!
{{* /myshortcode */>}} +``` ## Hugo Shortcodes @@ -61,7 +77,7 @@ closing shortcode. #### Example - {{%/* highlight html */%}} + {{* highlight html */>}}