about summary refs log tree commit diff
path: root/templates/feed.xml
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2024-07-04 13:47:18 -0700
committerFranck Cuny <franck@fcuny.net>2024-07-04 13:47:18 -0700
commitbb617eea58ac35679ed9568b103fdd8d5a0937b0 (patch)
tree3f555130bf1dcd31ad413515ade89f1e285d4448 /templates/feed.xml
parentfix yaml (diff)
downloadfcuny.net-bb617eea58ac35679ed9568b103fdd8d5a0937b0.tar.gz
add the feed and a few more fixes
Diffstat (limited to '')
-rw-r--r--templates/feed.xml39
1 files changed, 39 insertions, 0 deletions
diff --git a/templates/feed.xml b/templates/feed.xml
new file mode 100644
index 0000000..2ac0851
--- /dev/null
+++ b/templates/feed.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ lang }}">
+    <title>{{ config.title }}</title>
+    <link rel="self" type="application/atom+xml" href="{{ feed_url | safe }}"/>
+    <updated>{{ last_updated | date(format="%+") }}</updated>
+    <id>{{ feed_url | safe }}</id>
+    {%- set blog = get_section(path="blog/_index.md") -%}
+    {%- for page in blog.pages %}
+    <entry xml:lang="{{ page.lang }}">
+        <title>{{ page.title }}</title>
+        <published>{{ page.date | date(format="%+") }}</published>
+        <updated>{{ page.updated | default(value=page.date) | date(format="%+") }}</updated>
+        {% for author in page.authors %}
+        <author>
+          <name>
+            {{ author }}
+          </name>
+        </author>
+        {% else %}
+        <author>
+          <name>
+            {%- if config.author -%}
+              {{ config.author }}
+            {%- else -%}
+              Unknown
+            {%- endif -%}
+          </name>
+        </author>
+        {% endfor %}
+        <link rel="alternate" type="text/html" href="{{ page.permalink | safe }}"/>
+        <id>{{ page.permalink | safe }}</id>
+        {% if page.summary %}
+        <summary type="html">{{ page.summary }}</summary>
+        {% else %}
+        <content type="html" xml:base="{{ page.permalink | escape_xml | safe }}">{{ page.content }}</content>
+        {% endif %}
+    </entry>
+    {%- endfor %}
+</feed>