common/maps: Add Scratch.Values

Fixes #7335
This commit is contained in:
Bjørn Erik Pedersen 2020-05-29 18:50:12 +02:00
parent 2fd83db96b
commit f74a25b927
No known key found for this signature in database
GPG Key ID: 330E6E2BD4859D8F

View File

@ -113,6 +113,11 @@ Removes the given key
{{ .Scratch.Delete "greetings" }}
```
#### .Values
`Values` returns the raw backing map. Note that you should just use this method on the locally scoped `Scratch` instances you obtain via `newScratch`, not
`.Page.Scratch` etc., as that will lead to concurrency issues.
## Scope
The scope of the backing data is global for the given `Page` or `Shortcode`, and spans partial and shortcode includes.