From 2b3e51042cee40265d58178902a37c25c22973ab Mon Sep 17 00:00:00 2001 From: Ricardo Date: Wed, 11 Feb 2026 09:44:12 +0100 Subject: [PATCH] feat: type-aware rendering in blog sidebar Recent Posts widget and Previous/Next navigation now show colored icons and descriptive labels for likes, bookmarks, reposts, and replies instead of "Untitled". Co-Authored-By: Claude Opus 4.6 --- _includes/components/blog-sidebar.njk | 111 ++++++++++++++++++++++++-- 1 file changed, 103 insertions(+), 8 deletions(-) diff --git a/_includes/components/blog-sidebar.njk b/_includes/components/blog-sidebar.njk index 8844a20..4f609ac 100644 --- a/_includes/components/blog-sidebar.njk +++ b/_includes/components/blog-sidebar.njk @@ -38,16 +38,52 @@ {% if previousPost %} {% endif %} {% if nextPost %}
Next - - {{ nextPost.data.title or nextPost.data.name or "Untitled" }} + {% set _likedUrl = nextPost.data.likeOf or nextPost.data.like_of %} + {% set _bookmarkedUrl = nextPost.data.bookmarkOf or nextPost.data.bookmark_of %} + {% set _repostedUrl = nextPost.data.repostOf or nextPost.data.repost_of %} + {% set _replyToUrl = nextPost.data.inReplyTo or nextPost.data.in_reply_to %} + + {% if _likedUrl %} + + Liked {{ _likedUrl | replace("https://", "") | truncate(35) }} + {% elif _bookmarkedUrl %} + + {{ nextPost.data.title or ("Bookmarked " + (_bookmarkedUrl | replace("https://", "") | truncate(30))) }} + {% elif _repostedUrl %} + + Reposted {{ _repostedUrl | replace("https://", "") | truncate(35) }} + {% elif _replyToUrl %} + + Reply to {{ _replyToUrl | replace("https://", "") | truncate(35) }} + {% else %} + {{ nextPost.data.title or nextPost.data.name or (nextPost.templateContent | striptags | truncate(50)) or "Note" }} + {% endif %}
{% endif %} @@ -93,20 +129,79 @@ {% endif %} -{# Recent Posts Widget #} +{# Recent Posts Widget — type-aware #} {% if collections.posts %}

Recent Posts

-