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> </h2>
<ul class="post-list"> <ul class="post-list">
{% set postsShown = 0 %}
{% for post in listedPosts | head(maxItems) %} {% for post in listedPosts | head(maxItems) %}
{% set rawVisibility = post.data.visibility or post.data.properties.visibility %} {% set rawVisibility = post.data.visibility or post.data.properties.visibility %}
{% set visibility = (rawVisibility is array) ? rawVisibility[0] : rawVisibility %} {% set visibility = (rawVisibility is array) ? rawVisibility[0] : rawVisibility %}
@@ -31,6 +32,12 @@
{# Skip private and where/Loc posts #} {# Skip private and where/Loc posts #}
{% continue %} {% continue %}
{% endif %} {% 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 #} {# Detect post type from frontmatter properties #}
{% set likedUrl = post.data.likeOf or post.data.like_of %} {% set likedUrl = post.data.likeOf or post.data.like_of %}
{% set bookmarkedUrl = post.data.bookmarkOf or post.data.bookmark_of %} {% set bookmarkedUrl = post.data.bookmarkOf or post.data.bookmark_of %}