Skip to content

Instantly share code, notes, and snippets.

@ideasasylum
Created January 15, 2016 23:41
Show Gist options
  • Save ideasasylum/a909399a32bd05a712f0 to your computer and use it in GitHub Desktop.
Save ideasasylum/a909399a32bd05a712f0 to your computer and use it in GitHub Desktop.
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