I used this to add menus. I added hidden: true
to the _index.md
of one folder but it is still showing in the menu. How to hide it from the menu?
hidden
is not a pre-defined front matter variable:
https://gohugo.io/content-management/front-matter#front-matter-variables
Perhaps that’s something specific to your theme?
I am not using a theme. I tried this example you shared but got this error .execute of template failed: template: partials/navigation.html:4:28: executing "partials/navigation.html" at <.Pages.IsHome>: can't evaluate field Pages in type *navigation.MenuEntry
I have no taxonomies defined and all folders are in the root of content content/section/abcd.md
. This is a better solution if you can help me get it to work.
it works when I remove {{ else if and (not .Page.IsHome) (in .Page.Pages $currentPage) }} <li class="active"> <a href="{{ .URL }}">{{ .Name }} (active b)</a> </li>}
. Impressive!
Why do you think hidden: true
should work? I’m confused.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.