Skip to content

Commit

Permalink
✨ feat: use page description as summary
Browse files Browse the repository at this point in the history
If neither page description or summary are available,
only the post title will be shown.
  • Loading branch information
welpo committed Jun 23, 2023
1 parent f9d8f36 commit 54e88be
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions templates/atom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ lang }}">
<title>{{ config.title }}
{%- if term %} - {{ term.name }}
{%- elif section.title %} - {{ section.title }}
{%- endif -%}
</title>
{%- if config.description %} <subtitle>{{ config.description }}</subtitle> {%- endif %} <link
href="{{ feed_url | safe }}" rel="self" type="application/atom+xml" />
<link
href="
{%- if section -%}
{{ section.permalink | escape_xml | safe }}
{%- else -%}
{{ config.base_url | escape_xml | safe }}
{%- endif -%}
" />
<generator
uri="https://www.getzola.org/">Zola</generator>
<updated>{{ last_updated | date(format="%+")
}}</updated>
<id>{{ feed_url | safe }}</id> {%- for page in 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>
<author>
<name>
{%- if page.authors -%}
{{ page.authors[0] }}
{%- elif config.author -%}
{{ config.author }}
{%- else -%}
Unknown
{%- endif -%}
</name>
</author>
<link
rel="alternate" href="{{ page.permalink | safe }}" type="text/html" />
<id>{{
page.permalink | safe }}</id>
{% if page.summary %}
<summary type="html">{{ page.summary }}</summary>
{% elif page.description %}
<summary type="html">{{ page.description }}</summary>
{% endif %}
</entry>
{%- endfor %}
</feed>

0 comments on commit 54e88be

Please sign in to comment.