feat(feed): exclude unlisted posts from rss and json feeds

This commit is contained in:
svemagie
2026-03-08 16:37:33 +01:00
parent 13b223ce2a
commit b0c68dc375
8 changed files with 28 additions and 12 deletions

View File

@@ -18,8 +18,11 @@ permalink: "categories/{{ categoryFeed.slug }}/feed.xml"
<language>{{ site.locale | default('en') }}</language>
<atom:link href="{{ site.url }}/categories/{{ categoryFeed.slug }}/feed.xml" rel="self" type="application/rss+xml"/>
<atom:link href="https://websubhub.com/hub" rel="hub"/>
<lastBuildDate>{{ categoryFeed.posts | getNewestCollectionItemDate | dateToRfc822 }}</lastBuildDate>
{%- for post in categoryFeed.posts %}
{%- set listedCategoryPosts = categoryFeed.posts | excludeUnlistedPosts %}
{%- if listedCategoryPosts.length %}
<lastBuildDate>{{ listedCategoryPosts | getNewestCollectionItemDate | dateToRfc822 }}</lastBuildDate>
{%- endif %}
{%- for post in listedCategoryPosts %}
{%- set absolutePostUrl = site.url + post.url %}
{%- set postImage = post.data.photo %}
{%- if postImage %}