feat: configurable custom navbar items

The customMenu item from `data/<language>/site.yaml` will only appear if
its property `showOnNavbar` is `true`.

Example:
```
customMenus:
  - name: Imprint
    url: posts/imprint
    showOnNavbar: false
```
This commit is contained in:
stueja 2022-01-27 14:05:08 +01:00
parent 2b9ce8fb29
commit b7fef16087

View file

@ -115,10 +115,12 @@
</li> </li>
{{ end }} {{ end }}
{{ range $customMenus }} {{ range $customMenus }}
{{ if .showOnNavbar }}
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="{{ .url }}">{{ .name }}</a> <a class="nav-link" href="{{ .url }}">{{ .name }}</a>
</li> </li>
{{ end }} {{ end }}
{{ end }}
{{ if .IsTranslated }} {{ if .IsTranslated }}
{{ partial "navigators/lang-selector.html" . }} {{ partial "navigators/lang-selector.html" . }}
{{ end }} {{ end }}