commit 8b44028bea21e2704c2179376d7e573533733fdb parent 559676971e463a231393f405478bcf0d415d8740 Author: FIGBERT <figbert@figbert.com> Date: Tue, 22 Aug 2023 23:12:10 -0700 Fix feeds A change in the default template upstream (in Zola) led to an "Unknown" author field and only sending the summary instead of the content. This is better now! Diffstat:
M | config.toml | | | 1 | + |
A | templates/atom.xml | | | 43 | +++++++++++++++++++++++++++++++++++++++++++ |
2 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/config.toml b/config.toml @@ -1,6 +1,7 @@ base_url = "https://figbert.com" title = "FIGBERT" description = "figbert.com is the website and home of FIGBERT on the clearnet. It's my blog, portfolio, and wiki – my personal stash of information floating on the open web." +author = "FIGBERT" default_language = "en" generate_feed = false diff --git a/templates/atom.xml b/templates/atom.xml @@ -0,0 +1,43 @@ +<?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> + <content type="html">{{ page.content }}</content> + </entry> + {%- endfor %} +</feed>