My computer recently crashed and I had to install a new version of Hugo.
On my website under the content folder I have a folder called sections that has 4 files in it:
about.md, blog.md, contact.md, and search.md Here is my website
as you can see all those 4 sections are 4 links at the bottom of the page.
Now that I have updated my Hugo here is what I see:
I looked at my index.html under layouts and it has these lines:
<nav>
<ul>
{{ range (where .Data.Pages.ByWeight "Section" "sections") }}
<li>{{ if isset .Params "link" }}<a href="{{ index .Params "link" }}"{{else}}<a href="#{{ with .File }}{{ .TranslationBaseName }}{{ end }}"{{end}}>{{ if .Param "menuname" }}{{ .Param "menuname" }}{{ else }}{{ .Title }}{{ end }}</a></li>
{{ end }}
</ul>
</nav>
also:
<div id="main">
{{ range (where .Data.Pages "Section" "sections") }}
{{ .Render "onepagestyle" }}
{{ end }}
</div>
I really appreciate any help on this. Why I am not setting all the four links under sections folder on my main website page?
We need to see what’s inside the sections folder and the frontmatter of those files to have an opinion. I don’t remember any issue like that before, where a navigation “hops” up one level. Please post a link to your repository.
@pointyfar thanks so much for your help. After replacing .Data.Pages in both lines of ‘index.html’, now I can see all 4 links
Now the question is, why this code was working before but not working now? Has something changed on the new version of Hugo?
Thanks again, I really appreciate your help it was great.