mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-15 00:17:29 +00:00
Update shortcode-templates.md
This commit is contained in:
1 parent
e78aa48654
commit
399904959e
1 file changed
+5
-1
@@ -102,7 +102,9 @@ most helpful when the condition depends on either of the values, or both:
|
|||||||
|
|
||||||
If a closing shortcode is used, the `.Inner` variable will be populated with all of the content between the opening and closing shortcodes. If a closing shortcode is required, you can check the length of `.Inner` as an indicator of its existence.
|
If a closing shortcode is used, the `.Inner` variable will be populated with all of the content between the opening and closing shortcodes. If a closing shortcode is required, you can check the length of `.Inner` as an indicator of its existence.
|
||||||
|
|
||||||
A shortcode with content declared via the `.Inner` variable can also be declared without the inline content and without the closing shortcode by using the self-closing syntax:
|
A shortcode with content declared via the `.Inner` variable can also be declared without the
|
||||||
|
content and without the closing
|
||||||
|
by using the self-closing syntax:
|
||||||
|
|
||||||
```
|
```
|
||||||
{{</* innershortcode /*/>}}
|
{{</* innershortcode /*/>}}
|
||||||
@@ -367,6 +369,8 @@ More shortcode examples can be found in the [shortcodes directory for spf13.com]
|
|||||||
|
|
||||||
## Inline Shortcodes
|
## Inline Shortcodes
|
||||||
|
|
||||||
|
{{< new-in "0.52.0" >}}
|
||||||
|
|
||||||
Since Hugo 0.52, you can implement your shortcodes inline -- e.g. where you use them in the content file. This can be useful for scripting that you only need in one place.
|
Since Hugo 0.52, you can implement your shortcodes inline -- e.g. where you use them in the content file. This can be useful for scripting that you only need in one place.
|
||||||
|
|
||||||
This feature is disabled by default, but can be enabled in your site config:
|
This feature is disabled by default, but can be enabled in your site config:
|
||||||
|
|||||||
Reference in new issue
Block a user