mirror of
https://github.com/gohugoio/hugo.git
synced 2025-09-09 12:40:49 -04:00
doc: Add some Scratch slice samples
This commit is contained in:
parent
c7acc318b5
commit
c7d2260420
@ -42,6 +42,11 @@ The usage is best illustrated with some samples:
|
|||||||
{{ $.Scratch.Add "a2" "CD" }}
|
{{ $.Scratch.Add "a2" "CD" }}
|
||||||
{{ $.Scratch.Get "a2" }} {{/* => ABCD */}}
|
{{ $.Scratch.Get "a2" }} {{/* => ABCD */}}
|
||||||
|
|
||||||
|
{{ $.Scratch.Add "l1" (slice "A" "B") }}
|
||||||
|
{{ $.Scratch.Get "l1" }} {{/* => [A B] */}}
|
||||||
|
{{ $.Scratch.Add "l1" (slice "C" "D") }}
|
||||||
|
{{ $.Scratch.Get "l1" }} {{/* => [[A B C D] ] */}}
|
||||||
|
|
||||||
{{ $.Scratch.Set "v1" 123 }}
|
{{ $.Scratch.Set "v1" 123 }}
|
||||||
{{ $.Scratch.Get "v1" }} {{/* => 123 */}}
|
{{ $.Scratch.Get "v1" }} {{/* => 123 */}}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user