Add categories to atom feeds
All checks were successful
Build and copy to prod / build-and-copy (push) Successful in 1m43s

This commit is contained in:
Lewis Dale 2024-03-11 07:54:51 +00:00
parent 811d94d265
commit 5c0928922f
2 changed files with 5 additions and 0 deletions

View File

@ -25,6 +25,10 @@
<id>{{ absolutePostUrl }}</id>
<content xml:lang="{{ metadata.site.language }}" type="html">{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</content>
<summary>{{ post.content | excerpt }}</summary>
{% set filteredTags = post.data.tags | except("posts") | except("draft") %}
{% for tag in filteredTags %}
<category term="{{ tag }}" />
{% endfor %}
</entry>
{%- endfor %}
</feed>

View File

@ -18,6 +18,7 @@ eleventyComputed:
<name>{{ metadata.author.name }}</name>
<uri>{{ metadata.site.url }}</uri>
</author>
<category term="{{ tag }}" />
{%- for post in collections.posts | filterBy(tag) | reverse %}
{%- set absolutePostUrl = post.url | absoluteUrl(metadata.site.url) %}
<entry>