I would use .Store for that. For regular hugo
it doesn’t matter. .Store
was added to primarily solve the use case of
- A shortcode is using the .Page.Scratch to pass up some value to the calling template.
- It works fine on first render.
- Then, on change, we reset all the Scratch pads, but the shortcode is not re-evaluated, so templates depending on the value from the Shortcode now misbehaves.
- .Store will never be reset, so it survives rebuilds.