feat: nested tags (Obsidian-style) for categories system

Adds hierarchical tag support using "/" separator (e.g. "tech/programming/js").
- New filters: nestedSlugify, categoryMatches, categoryBreadcrumb,
  categoryGroupByRoot, categoryDirectChildren
- categories collection auto-generates ancestor pages for nested tags
- categories.njk: breadcrumb nav, sub-tags section, ancestor-aware post matching
- categories-index.njk: grouped tree view (root + indented children)
- categories widget: shows root tags only with child count badge
- All category links updated from slugify → nestedSlugify (backward-compatible)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
svemagie
2026-03-15 10:56:22 +01:00
parent 6572d87715
commit e8ba3b9ae6
18 changed files with 205 additions and 79 deletions

View File

@@ -33,10 +33,10 @@ permalink: "photos/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNumb
{% if post.data.category | withoutGardenTags %}
<span class="post-categories">
{% if post.data.category is string %}
<a href="/categories/{{ post.data.category | slugify }}/" class="p-category">{{ post.data.category }}</a>
<a href="/categories/{{ post.data.category | nestedSlugify }}/" class="p-category">{{ post.data.category }}</a>
{% else %}
{% for cat in (post.data.category | withoutGardenTags) %}
<a href="/categories/{{ cat | slugify }}/" class="p-category">{{ cat }}</a>
<a href="/categories/{{ cat | nestedSlugify }}/" class="p-category">{{ cat }}</a>
{% endfor %}
{% endif %}
</span>