feat: CMS-editable nav, categories taxonomy, site settings

- Move top nav from hugo.toml menus to data/nav.yml (CMS-editable)
- Add categories taxonomy alongside tags
- Add Decap CMS settings collection for nav management
- Add categories field to articles and essays in CMS config

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ludo 2026-04-11 18:06:02 +02:00
parent dd810f5a63
commit 8ab5787e68
Signed by: ludo
GPG key ID: F6E479DEFAB84D6E
4 changed files with 50 additions and 32 deletions

23
site/data/nav.yml Normal file
View file

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

View file

@ -7,37 +7,11 @@ title = 'ASW — Agentic Semantic Web'
[taxonomies]
tag = "tags"
category = "categories"
# ── Navigation menus ──────────────────────────────────────────────────
[[menus.main]]
name = "Home"
url = "/"
weight = 1
[[menus.main]]
name = "Docs"
url = "/docs/"
weight = 2
[[menus.main]]
name = "Notes"
url = "/notes/"
weight = 3
[[menus.main]]
name = "Essays"
url = "/essays/"
weight = 4
[[menus.main]]
name = "Articles"
url = "/articles/"
weight = 5
[[menus.main]]
name = "Tags"
url = "/tags/"
weight = 6
# ── Navigation ──────────────────────────────────────────────────────
# Top nav is driven by data/nav.yml (editable via Decap CMS).
# Docs sidebar is auto-generated from content/docs/ subdirectories.
# ── Docs sidebar ─────────────────────────────────────────────────────
# Auto-generated from content/docs/ subdirectories.

View file

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

View file

@ -17,7 +17,26 @@ slug:
encoding: ascii
clean_accents: true
# ── Site settings (file-based collections) ───────────────────────────
collections:
- name: settings
label: Settings
files:
- name: nav
label: Navigation
file: data/nav.yml
fields:
- label: Navigation Links
name: items
widget: list
fields:
- { label: Name, name: name, widget: string }
- { label: URL, name: url, widget: string }
- { label: Weight, name: weight, widget: number, hint: "Sort order (lower = first)" }
# ── Content collections ──────────────────────────────────────────────
- name: docs-getting-started
label: "Docs: Getting Started"
folder: content/docs/getting-started
@ -66,6 +85,7 @@ collections:
- { label: Title, name: title, widget: string }
- { label: Description, name: description, widget: string, required: false }
- { label: Date, name: date, widget: datetime, format: "YYYY-MM-DD" }
- { label: Categories, name: categories, widget: list, required: false, hint: "e.g. framework, tutorial, deep-dive" }
- { label: Tags, name: tags, widget: list, required: false }
- { label: AI Disclosure, name: ai-disclosure, widget: select, options: ["generated", "assisted", "none"], default: "assisted" }
- { label: AI Model, name: ai-model, widget: string, required: false }
@ -88,6 +108,7 @@ collections:
- { label: Date, name: date, widget: datetime, format: "YYYY-MM-DD" }
- { label: Tags, name: tags, widget: list, required: false }
- { label: Draft, name: draft, widget: boolean, default: true }
- { label: Categories, name: categories, widget: list, required: false }
- { label: AI Disclosure, name: ai-disclosure, widget: select, options: ["generated", "assisted", "none"], default: "assisted" }
- { label: AI Model, name: ai-model, widget: string, required: false }
- { label: AI Provider, name: ai-provider, widget: string, required: false, default: "Anthropic" }