feat: add feeds page (#6)

* feat: add feeds page

* feat: rename posts feed url
This commit is contained in:
Devin Haska 2024-09-29 21:55:15 -07:00 committed by GitHub
parent 75902fd510
commit 183380f70d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 20 additions and 8 deletions

26
src/feeds/posts.njk Normal file
View file

@ -0,0 +1,26 @@
---
permalink: /feeds/posts.xml
layout: null
eleventyExcludeFromCollections: true
excludeFromSitemap: true
---<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ meta.siteName }}</title>
<subtitle>{{ meta.siteDescription }}</subtitle>
<link href="{{ meta.url }}/feeds/posts.xml" rel="self" />
<link href="{{ meta.url }}/" rel="alternate" type="text/html" />
<id>{{ meta.url }}/</id>
<author>
<name>{{ meta.author }}</name>
</author>
{% for post in collections.post %}
<entry>
<id>{{ meta.url }}{{ post.url }}</id>
<title>{{ post.data.title | escape }}</title>
<link href="{{ meta.url }}{{ post.url }}" />
<pubDate>{{ post.date }}</pubDate>
{%- for tag in post.data.tags %}<category term="{{ tag }}" />{%- endfor %}
<content type="html">{{ post.content | escape }}</content>
</entry>
{% endfor %}
</feed>