Hi there!
I need to put menuentrys into a navbar based on the title.
I do it like this:
{{ if or (eq .Title "Contact") (eq .Title "Kontakt") }}
<ul class="nav navbar-nav navbar-right">
<li class=""><a href="/contact">Contact</a></li>
</ul>
{{ end }}
The navbar itself is rendered as wanted and i don’t see any errors by Hugo but the content is missing.
I wonder what could be wrong?
Edit: I figured out that hugo only renders the entry when i am on the specific page :o
Solved!
I just made it as before and as similar as in the official multilingual example.
Like:
{{ range (index .Site.Taxonomies.menu .Params.lang).Pages.ByDate}}
{{ if or (eq .Title "Contact") (eq .Title "Kontakt") }}
<ul class="nav navbar-nav navbar-right">
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
</ul>
{{ end }}
{{ end }}