From 4af7c49c6a8c55e9dfb23ee693ccbba585926249 Mon Sep 17 00:00:00 2001 From: Sven Date: Sun, 15 Mar 2026 12:14:32 +0100 Subject: [PATCH] feat: inline card template in /posts to show tags inside cards Non-garden tags shown as small chips in the card body (above footer). The 'garden' tag shown in the card footer on the right side of the publish-state badge, using margin-left:auto. Co-Authored-By: Claude Sonnet 4.6 --- scripts/patch-endpoint-posts-search-tags.mjs | 59 +++++++++++++++++--- 1 file changed, 50 insertions(+), 9 deletions(-) diff --git a/scripts/patch-endpoint-posts-search-tags.mjs b/scripts/patch-endpoint-posts-search-tags.mjs index 61853eb3..47e81f1f 100644 --- a/scripts/patch-endpoint-posts-search-tags.mjs +++ b/scripts/patch-endpoint-posts-search-tags.mjs @@ -153,15 +153,56 @@ const newView = `{% extends "document.njk" %}
    {%- for item in posts %}
  1. - {{ card(item) | indent(4) }} - {%- if item.tagLinks and item.tagLinks.length > 0 %} -
    -
    Tags
    - {%- for tagLink in item.tagLinks %} -
    {{ tagLink.text }}
    - {%- endfor %} -
    - {%- endif %} +
    + {%- if item.photo %} +
    + {{ item.photo.alt }} +
    + {%- endif %} +
    + {%- if item.title %} +

    + {%- if item.url %} + + {%- endif %} + {{- icon(item.icon) if item.icon -}} + {{- item.title | safe -}} + {%- if item.url %} + + {%- endif %} +

    + {%- endif %} + {{ prose({ classes: "card__meta", text: item.description.text, html: item.description.html }) | indent(10) if item.description }} + {%- set hasNonGarden = false %} + {%- for tl in item.tagLinks %} + {%- if tl.text != "garden" %}{%- set hasNonGarden = true %}{%- endif %} + {%- endfor %} + {%- if hasNonGarden %} +
    + {%- for tl in item.tagLinks %} + {%- if tl.text != "garden" %} + {{ tl.text }} + {%- endif %} + {%- endfor %} +
    + {%- endif %} + {%- if item.published or item.badges %} + + {%- endif %} +
    +
  2. {%- endfor %}