feat: show garden badge in all post list views and overviews

- garden-badge.njk now resolves stage from post.data.gardenStage in
  list contexts (no set required), or gardenStage in post page context
- Badge added after categories in: blog, articles, notes, photos,
  bookmarks, likes, replies, reposts, recent-posts section
- Badge is clickable, links to /garden/#<stage>
This commit is contained in:
svemagie
2026-03-15 09:04:29 +01:00
parent bb1b2d1fda
commit 01a36d4163
10 changed files with 47 additions and 6 deletions

View File

@@ -53,6 +53,7 @@ permalink: "replies/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNum
{% endif %}
</span>
{% endif %}
{% include "components/garden-badge.njk" %}
</div>
{# Support both camelCase (Indiekit Eleventy preset) and underscore (legacy) property names #}
{% set replyTo = post.data.inReplyTo or post.data.in_reply_to %}
@@ -86,6 +87,7 @@ permalink: "replies/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNum
via Web
</span>
{% endif %}
{% include "components/garden-badge.njk" %}
</p>
{% endif %}
<div class="e-content prose dark:prose-invert prose-sm mt-3 max-w-none">
@@ -116,6 +118,7 @@ permalink: "replies/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNum
Previous
</span>
{% endif %}
{% include "components/garden-badge.njk" %}
{% if pagination.href.next %}
<a href="{{ pagination.href.next }}" class="pagination-link" aria-label="Next page">
@@ -128,6 +131,7 @@ permalink: "replies/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNum
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg>
</span>
{% endif %}
{% include "components/garden-badge.njk" %}
</div>
</nav>
{% endif %}