Hi, the template and directory structure below used to produce a sidebar with a recursive filetree menu, but now it doesn’t anymore. To be precise, I can’t iterate through what’s under “content/docs”, when before I could. Yet the site is rendered identically as before, pages appear under /en/ all right.
It’s supposed to render as something like:
(start template)
<menu>
(iterate filetree under docs)
<li>{{ if branch bundle }}<details><summary>{{ branch bundle title }}</summary> -> (start_template)
</details>{{else}}(link page)</li>(end iterate)
(end template)
Your menu code works fine for me, provided that I have “bookHidden = false” set on relevant pages, including section pages. Perhaps you fouled up a cascade somewhere.
I don’t know what to tell you. Your code worked fine for me. I suggest you put in some debugging statements on your side to check for page counts, etc.
Within the template, at its start, the value of {{.}} is map[CurrentPage:Page(/docs/love/spirituality) Section:Page(/docs)], the value of {{.Section}} is Page(/docs) and the value of {{.Section.Pages}} is Pages(0).
So it seems to descend into /docs, but sees nothing. That’s why I said I could iterate through the folders under docs/. I don’t know what more debugging to do.
You have a repo. Change list = 'never'' by list = 'always' in the hugo.toml, and nothing else. What happens then ?
edit: sorry, I mixed up with the “unrecognized character” thread, where someone gave an advice that might or not bear on this topic here). Repo corrected.
Yeah, which is the equivalent of me not asking anything, because I can’t use git, I couldn’t make it work (not to upload things). Some people are not developers.
This topic is closed, I’ll manage to rewrite the template. It’s never good to keep legacy code that “just works” without understanding it anyway.