about summary refs log tree commit diff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/base.html2
-rw-r--r--templates/feed.xml39
2 files changed, 40 insertions, 1 deletions
diff --git a/templates/base.html b/templates/base.html
index 7eeeaf6..75d108c 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -8,7 +8,7 @@
 
     <meta name="author" content="{{- config.author -}}" />
     <meta name="description" content="{%- block description -%}{{- config.description -}}{%- endblock description -%}" />
-    <link rel="alternate" type="application/atom+xml" title="Blog posts" href="{{ get_url(path="/blog/atom.xml", trailing_slash=false) }}" />
+    <link rel="alternate" type="application/atom+xml" title="Blog posts" href="{{ get_url(path="/feed.xml", trailing_slash=false) }}" />
 
     <title>{% block title %}{{- config.title -}}{% endblock title %}</title>
   </head>
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>