doc: clarify Scratch usage in shortcodes - hugo - [fork] hugo port for 9front
(HTM) git clone git@git.drkhsh.at/hugo.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
(DIR) README
(DIR) LICENSE
---
(DIR) commit bef25432d1a481359e3d00deaca79c8b3593bd63
(DIR) parent be62c948724244c188d2fd7ac05240a6412d5797
(HTM) Author: bep <bjorn.erik.pedersen@gmail.com>
Date: Sun, 19 Apr 2015 11:30:10 +0200
doc: clarify Scratch usage in shortcodes
Diffstat:
M docs/content/extras/scratch.md | 1 +
1 file changed, 1 insertion(+), 0 deletions(-)
---
(DIR) diff --git a/docs/content/extras/scratch.md b/docs/content/extras/scratch.md
@@ -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 }}`.