Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Navbar in hugo
<div class="top-bar">
<div class="top-bar-left">
<ul class="menu align-right">
<li class='menu-text'><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></li>
</ul>
</div>
<div class="top-bar-right">
<ul class="menu">
{{ $currentNode := . }}
{{ range .Site.Menus.main }}
<li><a href="{{ .URL }}" class='{{ if $currentNode.IsMenuCurrent "main" . }} active {{ end }}'>{{ .Name }}</a></li>
{{ end }}
</ul>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment