1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2025-05-10 14:36:01 +02:00

Add custom navbar support

- default behaviour is backward compatible: all non-post pages
- optionally enable custom navbar using hugo menu functionality
This commit is contained in:
Rassie Smit
2016-11-17 10:04:14 +00:00
parent b03b939124
commit aa7bd11522
2 changed files with 26 additions and 3 deletions

View File

@ -31,8 +31,14 @@
<div class="container">
<nav class="nav blog-nav">
<a class="nav-link {{ if .IsHome }}active{{ end }}" href="{{ .Site.BaseURL | absLangURL }}">{{ i18n "home" }}</a>
{{ range where .Site.Pages "Type" "!=" "post" }}
<a class="nav-link" href="{{ .Permalink }}">{{ .Title }}</a>
{{ if .Site.Params.custom_navbar }}
{{ range .Site.Menus.navbar }}
<a class="nav-link" href="{{.URL | absURL }}">{{ .Name }}</a>
{{ end }}
{{ else }}
{{ range where .Site.Pages "Type" "!=" "post" }}
<a class="nav-link" href="{{ .Permalink }}">{{ .Title }}</a>
{{ end }}
{{ end }}
</nav>
</div>