If I mention page.Sections in a partial invoked for taxonomy.html, page.Pages is empty unless I print it

This is a weird one. Seems like a bug to me.

Try it yourself:

  1. Download GitHub - willfaught/paige: Powerful, pliable pixel perfection. An advanced Hugo theme., “sections” branch.
  2. Run the exampleSite. The /series/ page is not empty.
  3. Delete this line. Rebuild the exampleSite (you must kill hugo server and re-run it) and refresh the page. The /series/ page will be empty.
  4. Remove mention of .Sections in layouts/partials/paige/subpages.html. Rebuild (re-run) the exampleSite and refresh the page. The /series/ page is not empty.

EDIT: Correct --noFastRender to --disableFastRender

What happens if you do:

hugo serve --disableFastRender

If you look at Code in tags/baseof.html and tags/list.html only works after hugo serve when --disableFastRender is flagged that helped someone else with a similar issue.

I have also seen this behavior were using --disableFastRender gets tags page serving correctly (and for me, the issue only affects the server, not building for production).

In my case the suggested

hugo --printPathWarnings

had no warnings, so the issue wasn’t the same as the post I mentioned, but the --disableFastRender did work.

@cshoredaniel There isn’t a --noFastRender flag:

❯ hugo server --themesDir ../.. --enableGitInfo --printPathWarnings --noFastRender
Error: unknown flag: --noFastRender
❯ hugo env
hugo v0.111.3+extended darwin/amd64 BuildDate=unknown

--printPathWarnings didn’t print anything.

I found --disableFastRender. The behavior was the same, unfortunately.

Sorry about the confusion on the flag name; my brain translated it between viewing and typing.

I think that you are right that there is something strange going on here. I’ll have to make a test case as well.

EDIT: This appears to be due to my having been on native Windows and having long paths due to deep nesting, which Windows doesn’t seem to like.

Or, once I push the branch I am working on, my repo is public:

It’s rather large though, so I’ll try to get to a task case.

Also, I’ve been finding I sometime need to do:

hugo --ignoreCache

and then

hugo serve

It has not been sufficient to do:

hugo serve --ignoreCache --disableFastRender

for things to render correctly after a change.

1 Like

So in my case the problem was that I have WSL2 on Windows and have Hugo binary on both WSL2 and native Windows. In native Windows if I just use hugo instead of hugo.exe it runs the WSL2 binary when I think I’m using the Windows binary and that causes issues (that is when running from PowerShell, running WSL hugo from within a proper WSL2 session works fine).

Thanks for trying anyway! :slight_smile:

I reported this bug at If I mention page.Sections in a partial invoked for taxonomy.html, page.Pages is empty unless I print it · Issue #10869 · gohugoio/hugo · GitHub.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.