Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Page.Scratch not reset on rebuilds in live-reload #4683

Closed
bep opened this issue Apr 29, 2018 · 2 comments · Fixed by #4684
Closed

.Page.Scratch not reset on rebuilds in live-reload #4683

bep opened this issue Apr 29, 2018 · 2 comments · Fixed by #4684

Comments

@bep
Copy link
Member

bep commented Apr 29, 2018

This was kind of accidentally introduced in Hugo 0.40. I guess I was tired. This is related to live-reloads (not fuill builds) and .Scratch.Add.

Not 100% sure this should be fixed, though, as to get some kind of control of this global state, you should set it to a known initial value before adding to it.

{{ .Scratch.Set "counter" 0 }}
{{ .Scratch.Add "counter" 1  }}

/cc @regisphilibert

@bep bep added the Bug label Apr 29, 2018
@bep bep added this to the v0.40.2 milestone Apr 29, 2018
bep added a commit to bep/hugo that referenced this issue Apr 29, 2018
@bep
Copy link
Member Author

bep commented Apr 29, 2018

But I guess that, looking at the recent gallery example in the forum, we should fix this.

@bep bep closed this as completed in #4684 Apr 30, 2018
bep added a commit that referenced this issue Apr 30, 2018
@github-actions
Copy link

github-actions bot commented Mar 4, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant