fix: restore Recent Posts section with fallback if all posts filtered

This commit is contained in:
svemagie
2026-03-12 11:40:17 +01:00
parent 841f2650c6
commit 970ecb42c5
@@ -21,6 +21,7 @@
</h2>
<ul class="post-list">
{% 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 %}
<li class="text-surface-600 dark:text-surface-400">No recent posts available.</li>
{% 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 %}