about summary refs log tree commit diff
path: root/templates/feed.xml
blob: 2ac0851e9d321a13e1db994f861d0e98d09f3165 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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>