mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
doc: clarify Scratch usage in shortcodes
This commit is contained in:
parent
be62c94872
commit
bef25432d1
1 changed files with 1 additions and 0 deletions
|
@ -40,5 +40,6 @@ The usage is best illustrated with some samples:
|
|||
```
|
||||
|
||||
**Note:** The examples above uses the special `$` variable, which refers to the top-level node. This is the behavior you most likely want, and will help remove some confusion when using `Scratch` inside page range loops -- and you start inadvertently calling the wrong `Scratch`. But there may be use cases for `{{ .Scratch.Add "key" "some value" }}`.
|
||||
**Note:** To use `Scratch` in a `shortcode`, you will have to use the shortcode's Page's `Scratch`: `{{ .Page.Scratch.Add "a1" 12 }}` or `{{ $.Page.Scratch.Add "a1" 12 }}`.
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue