From c375b08eddc5963595b866af6bcada842b268be5 Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Sun, 8 Mar 2026 09:28:14 +0100 Subject: [PATCH] Style recent posts widgets like rmendes.net --- .../components/widgets/recent-posts-blog.njk | 56 +++++++++++++------ .../components/widgets/recent-posts-blog.njk | 56 +++++++++++++------ .../components/widgets/recent-posts.njk | 51 ++++++++++++----- 3 files changed, 115 insertions(+), 48 deletions(-) diff --git a/_includes/components/widgets/recent-posts-blog.njk b/_includes/components/widgets/recent-posts-blog.njk index 54e62b1..b5f5588 100644 --- a/_includes/components/widgets/recent-posts-blog.njk +++ b/_includes/components/widgets/recent-posts-blog.njk @@ -15,12 +15,12 @@ {% if _likedUrl %}
- +
- + Liked {{ _likedUrl | replace("https://", "") | truncate(40) }} -
@@ -28,12 +28,12 @@ {% elif _bookmarkedUrl %}
- + @@ -41,12 +41,12 @@ {% elif _repostedUrl %}
- +
- + Reposted {{ _repostedUrl | replace("https://", "") | truncate(40) }} -
@@ -54,24 +54,46 @@ {% elif _replyToUrl %}
- +
Reply to {{ _replyToUrl | replace("https://", "") | truncate(40) }} -
+
+ + {% elif post.data.title %} +
+ +
+ + {{ post.data.title }} + +
{% else %} - - {{ post.data.title or post.data.name or (post.templateContent | striptags | truncate(50)) or "Note" }} - - +
+ +
+ + {{ post.templateContent | striptags | truncate(50) or "Note" }} + + +
+
{% endif %} {% endif %} diff --git a/theme/_includes/components/widgets/recent-posts-blog.njk b/theme/_includes/components/widgets/recent-posts-blog.njk index af6e224..b5f5588 100644 --- a/theme/_includes/components/widgets/recent-posts-blog.njk +++ b/theme/_includes/components/widgets/recent-posts-blog.njk @@ -15,12 +15,12 @@ {% if _likedUrl %}
- +
- + Liked {{ _likedUrl | replace("https://", "") | truncate(40) }} -
@@ -28,12 +28,12 @@ {% elif _bookmarkedUrl %}
- + @@ -41,12 +41,12 @@ {% elif _repostedUrl %}
- +
- + Reposted {{ _repostedUrl | replace("https://", "") | truncate(40) }} -
@@ -54,24 +54,46 @@ {% elif _replyToUrl %}
- +
Reply to {{ _replyToUrl | replace("https://", "") | truncate(40) }} -
+
+ + {% elif post.data.title %} +
+ +
+ + {{ post.data.title }} + +
{% else %} - - {{ post.data.title or post.data.name or (post.templateContent | striptags | truncate(50)) or "Note" }} - - +
+ +
+ + {{ post.templateContent | striptags | truncate(50) or "Note" }} + + +
+
{% endif %} {% endif %} diff --git a/theme/_includes/components/widgets/recent-posts.njk b/theme/_includes/components/widgets/recent-posts.njk index 7fef78d..9b1cd47 100644 --- a/theme/_includes/components/widgets/recent-posts.njk +++ b/theme/_includes/components/widgets/recent-posts.njk @@ -19,10 +19,10 @@
- + Liked {{ likedUrl | replace("https://", "") | truncate(40) }} -
@@ -34,10 +34,10 @@ @@ -49,10 +49,10 @@
- + Reposted {{ repostedUrl | replace("https://", "") | truncate(40) }} -
@@ -67,20 +67,43 @@ Reply to {{ replyToUrl | replace("https://", "") | truncate(40) }} -
+
+ + {% elif post.data.title %} + {# Article #} +
+ +
+ + {{ post.data.title }} + +
{% else %} - {# Article / Note / other #} - - {{ post.data.title or post.data.name or (post.templateContent | striptags | truncate(50)) or "Note" }} - - + {# Note #} +
+ +
+ + {{ post.templateContent | striptags | truncate(50) or "Note" }} + + +
+
{% endif %} {% endfor %}