diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-11-26 11:01:27 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-11-27 16:14:09 +0100 |
commit | bc337e6ab5a75f1f1bfe3a83f3786d0afdb6346c (patch) | |
tree | 1f3b087822337acbde696147f18e86b2c9f1d8eb /.github/calibre | |
parent | 112461fded0d7970817ce7bf476c4763922ad314 (diff) |
Add inline shortcode support
An inline shortcode's name must end with `.inline`, all lowercase.
E.g.:
```bash
{{< time.inline >}}{{ now }}{{< /time.inline >}}
```
The above will print the current date and time.
Note that an inline shortcode's inner content is parsed and executed as a Go text template with the same context as a regular shortcode template.
This means that the current page can be accessed via `.Page.Title` etc. This also means that there are no concept of "nested inline shortcodes".
The same inline shortcode can be reused later in the same content file, with different params if needed, using the self-closing syntax:
```
{{< time.inline />}}
```
Fixes #4011
Diffstat (limited to '.github/calibre')
0 files changed, 0 insertions, 0 deletions