From 970ecb42c543e0ac4123387f40e00516d3a38fac Mon Sep 17 00:00:00 2001
From: svemagie <869694+svemagie@users.noreply.github.com>
Date: Thu, 12 Mar 2026 11:40:17 +0100
Subject: [PATCH] fix: restore Recent Posts section with fallback if all posts
filtered
---
_includes/components/sections/recent-posts.njk | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/_includes/components/sections/recent-posts.njk b/_includes/components/sections/recent-posts.njk
index 2719beb..b4e9a3b 100644
--- a/_includes/components/sections/recent-posts.njk
+++ b/_includes/components/sections/recent-posts.njk
@@ -21,6 +21,7 @@
+ {% set postsShown = 0 %}
{% for post in listedPosts | head(maxItems) %}
{% set rawVisibility = post.data.visibility or post.data.properties.visibility %}
{% set visibility = (rawVisibility is array) ? rawVisibility[0] : rawVisibility %}
@@ -31,6 +32,12 @@
{# Skip private and where/Loc posts #}
{% continue %}
{% endif %}
+ {% set postsShown = postsShown + 1 %}
+ ...existing code...
+ {% endfor %}
+ {% if postsShown == 0 %}
+ - No recent posts available.
+ {% endif %}
{# Detect post type from frontmatter properties #}
{% set likedUrl = post.data.likeOf or post.data.like_of %}
{% set bookmarkedUrl = post.data.bookmarkOf or post.data.bookmark_of %}