Update shortcode-templates.md

This commit is contained in:
Bjørn Erik Pedersen 2018-10-28 00:24:49 +02:00 committed by GitHub
parent c01b024348
commit 0848044474
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,6 +34,14 @@ Hugo's built-in shortcodes cover many common, but not all, use cases. Luckily, H
To create a shortcode, place an HTML template in the `layouts/shortcodes` directory of your [source organization][]. Consider the file name carefully since the shortcode name will mirror that of the file but without the `.html` extension. For example, `layouts/shortcodes/myshortcode.html` will be called with either `{{</* myshortcode /*/>}}` or `{{%/* myshortcode /*/%}}` depending on the type of parameters you choose.
You can organize your shortcodes in subfolders, e.g. in `layouts/shortcodes/boxes`. These shortcodes would then be accessible with their relative path, e.g:
```
{{< boxes/square >}}
```
Note the forward slash.
### Shortcode Template Lookup Order
Shortcode templates have a simple [lookup order][]: