Closed Lruihao closed 8 months ago
.Scratch
works fine in .Render
.
Oh sorry, it's not work fine for my theme:
At summary part, it's bad..
But, at single page,it's work fine like before:
see post-author.html
It was working fine up to version 0.122.0, but after updating to 0.123.0 it became terrible. Looking forward to your solution.
@Lruihao I am unable to reproduce the problem. I followed your instructions: https://fixit.lruihao.cn/documentation/getting-started/
Instead of asking us to create a new site, configure it, and create content, please create a minimal reproducible example that consistently fails.
@Lruihao Please provide step-by-step instructions, including which page I am supposed to view to see the problem.
OK, I can intermittently reproduce the problem looking at the home page... with version v0.122.0.
This has nothing to do with v0.123.0.
It's happening intermittently when you run hugo server
because scratch pads set with .Scratch.Set
do not survive server rebuilds. Use .Store.Set
and .Store.Get
instead. See:
https://gohugo.io/methods/page/store/
And make sure you read the section titled "Determinate values": https://gohugo.io/methods/page/store/#determinate-values
If you need additional assistance please create a new topic in the forum. Thanks.
@jmooring In fact, I tried before creating this issue Store, but this issue still occurs during the first Hugo serve or build, so I reverse this commit.
I will create a discussion on the forum later. Thanks!
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.
At
single.html
, the.Scratch
method is valid:But via .Render, the
.Scratch
method is invalid:In
summary.html
,.Scratch.Get "author"
got<nil>
I don't know why, but what I can confirm is that this bug occurs after updating version 0.123.0.
Complete code
What version of Hugo are you using (
hugo version
)?This problem occurs in 0.123.0
Does this issue reproduce with the latest release?
Yes