fix: wrap nav data in items key for Decap CMS compatibility

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ludo 2026-04-11 18:10:16 +02:00
parent 219cc91dc2
commit c0426ea746
Signed by: ludo
GPG key ID: F6E479DEFAB84D6E
2 changed files with 20 additions and 19 deletions

View file

@ -1,23 +1,24 @@
- name: Home items:
url: / - name: Home
weight: 1 url: /
weight: 1
- name: Docs - name: Docs
url: /docs/ url: /docs/
weight: 2 weight: 2
- name: Notes - name: Notes
url: /notes/ url: /notes/
weight: 3 weight: 3
- name: Essays - name: Essays
url: /essays/ url: /essays/
weight: 4 weight: 4
- name: Articles - name: Articles
url: /articles/ url: /articles/
weight: 5 weight: 5
- name: Tags - name: Tags
url: /tags/ url: /tags/
weight: 6 weight: 6

View file

@ -1,7 +1,7 @@
<nav> <nav>
<ul><li><a href="/"><strong>{{ .Site.Title }}</strong></a></li></ul> <ul><li><a href="/"><strong>{{ .Site.Title }}</strong></a></li></ul>
<ul> <ul>
{{- range sort hugo.Data.nav "weight" }} {{- range sort hugo.Data.nav.items "weight" }}
<li><a href="{{ .url }}"{{ if eq (relURL .url) $.RelPermalink }} aria-current="page"{{ end }}>{{ .name }}</a></li> <li><a href="{{ .url }}"{{ if eq (relURL .url) $.RelPermalink }} aria-current="page"{{ end }}>{{ .name }}</a></li>
{{- end }} {{- end }}
</ul> </ul>