Hello All,
I don’t know if this question has been answered before, but one user of my hugo theme would like to have “as-is” Menu case. (and not sentence case)
For example, if I type “about” in config under “menu.main”, it appears as “About”, but the user would like it to be “about”.
Can someone please help with this?
Thanks
Bala
This is the code I use for the menu with dropdowns.
<nav id="main-nav" class="clearfix">
<div class="container clearfix">
<ul class="root">
{{ $currentPage := . }}
{{ range .Site.Menus.main.ByWeight }}
<li class="menu-item menu-item-type-post_type menu-item-object-page {{if $currentPage.HasMenuCurrent "main" . }} active{{end}}">
<a href="{{ .URL }}">{{ .Name }}</a>
{{ if .HasChildren }}
<ul class="sub-menu">
{{ range .Children }}
<li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children">
<a href="{{ .URL }}">{{ .Name }}
</a>
{{ if .HasChildren }}
<ul class="sub-menu">
{{ range .Children }}
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
<a href="{{ .URL }}">{{ .Name }}
</a>
</li>
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
</ul>
</div><!-- .container -->
</nav><!-- #main-nav -->