commit 1e0168d394fe5f027ee70761e3bfb98004db5990 parent 0f6527f75b0c416d91b0882f4fede223e650b381 Author: FIGBERT <figbert@figbert.com> Date: Sat, 21 Sep 2024 13:17:01 -0700 Support book, work, and link types in atom.xml Diffstat:
M | templates/atom.xml | | | 97 | +++++++++++++++++++++++++++++++++++++++++++++++++------------------------------ |
1 file changed, 60 insertions(+), 37 deletions(-)
diff --git a/templates/atom.xml b/templates/atom.xml @@ -1,43 +1,66 @@ <?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 }} + <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 -%} - </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 }} + "/> + <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=" + {%- if page.extra.type and page.extra.type == "link" -%} + {{ page.extra.link | safe }} {%- else -%} - {{ config.base_url | escape_xml | safe }} + {{ page.permalink | 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 %} + " type="text/html"/> + <id>{{ page.permalink | safe }}</id> + <content type="html"> + {%- if page.extra is containing("book") %} + <small> + <i>{{ page.extra.book }}</i> by {{ page.extra.author }}. <br/> + Finished on {{ page.extra.finished | date(format="%B %d, %Y") }}. <br/> + Rating: {{ page.extra.rating }} <br/> + </small> + {%- elif page.extra.type and page.extra.type == "work" %} + <small> + Began: {{ page.extra.start | date(format="%d %b %Y") }} <br/> + Concluded: {{ page.extra.end | date(format="%d %b %Y") }} + </small> + {%- endif %} + {{ page.content }} + {%- if page.extra.type and page.extra.type == "link" %} + <a href="{{ page.permalink | safe }}">★</a> + {%- endif %} + </content> + </entry> + {%- endfor %} </feed>