Explorar o código

feat: configurable custom navbar items (#514)

* 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
```

* fix: change logic from  to

Co-authored-by: stueja <jan@jBook.local>
Co-authored-by: Emruz Hossain <hossainemruz@gmail.com>
Jan %!s(int64=3) %!d(string=hai) anos
pai
achega
bfa1e4c2b3
Modificáronse 1 ficheiros con 5 adicións e 3 borrados
  1. 5 3
      layouts/partials/navigators/navbar.html

+ 5 - 3
layouts/partials/navigators/navbar.html

@@ -115,9 +115,11 @@
           </li>
         {{ end }}
         {{ range $customMenus }}
-          <li class="nav-item">
-            <a class="nav-link" href="{{ .url }}">{{ .name }}</a>
-          </li>
+            {{ if (not .hideFromNavbar) }}
+              <li class="nav-item">
+                <a class="nav-link" href="{{ .url }}">{{ .name }}</a>
+              </li>
+            {{ end }}
         {{ end }}
         {{ if .IsTranslated }}
           {{ partial "navigators/lang-selector.html" . }}