mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
420c9e4d3d
The variable scope in the Go templates makes it hard, if possible at all, to write templates with counter variables or similar state. This commit fixes that by adding a writable context to Node, backed by a map: Scratch. This context has three methods, Get, Set and Add. The Add is tailored for counter variables, but can be used for any built-in numeric values or strings. |
||
---|---|---|
.. | ||
content.go | ||
content_test.go | ||
general.go | ||
general_test.go | ||
path.go | ||
path_test.go | ||
pygments.go | ||
url.go | ||
url_test.go |