diff options
| author | a73x <[email protected]> | 2024-09-03 08:52:12 +0100 |
|---|---|---|
| committer | a73x <[email protected]> | 2024-09-03 08:52:12 +0100 |
| commit | 17b008f72f284ea989fddb2b6b52c2ca558c985a (patch) | |
| tree | acb286b07dd62fc0e539ae466536132b3c9b7c94 /templates | |
| parent | 1c0e1cc8c6a51457907ce028599c2bcad82d0bfd (diff) | |
chore(html): refactor nav to be more dynamic
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/layouts/_default.html | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/templates/layouts/_default.html b/templates/layouts/_default.html index 09b2239..2e7ec0c 100644 --- a/templates/layouts/_default.html +++ b/templates/layouts/_default.html @@ -61,20 +61,15 @@ <sub>high effort, low reward</sub> <nav> <ul> - {{ if eq .Path "index" }} - <li><a href="/">home</a></li> - {{else}} - <li><a class="no-decorations" href="/">home</a></li> - {{end}} - {{ range $key, $value := .Collections }} - {{if ne $key "all"}} - {{ if eq $.Path $key }} - <li><a href="/{{$key}}">{{$key}}</a></li> - {{else}} - <li><a class="no-decorations" href="/{{$key}}">{{$key}}</a></li> - {{end}} - {{end}} - {{end}} + <!--{{$.Path}}--> + {{ range $key, $value := .Nav}} + <!--{{$key}}--> + {{ if eq $.Path $key }} + <li><a href="{{$key}}">{{$value.Meta.title}}</a></li> + {{else}} + <li><a class="no-decorations" href="{{$key}}">{{$value.Meta.title}}</a></li> + {{end}} + {{end}} </ul> </nav> {{ template "content" . }} |
