add separator between dates in Atom feed

This commit is contained in:
welpo 2024-07-11 23:01:55 +02:00
parent 313e573a3a
commit f3946dc7c6
No known key found for this signature in database
GPG key ID: A2F978CF4EC1F5A6
2 changed files with 15 additions and 2 deletions

View file

@ -54,12 +54,22 @@
<xsl:for-each select="/atom:feed/atom:entry">
<section class="bloglist-row bottom-divider">
<ul class="bloglist-meta">
<xsl:if test="$post_listing_date = 'date' or $post_listing_date = 'both'">
<xsl:variable name="show_date" select="$post_listing_date = 'date' or $post_listing_date = 'both'"/>
<xsl:variable name="show_updated" select="$post_listing_date = 'updated' or $post_listing_date = 'both'"/>
<xsl:if test="$show_date">
<li class="date">
<xsl:value-of select="substring(atom:published, 0, 11)"/>
</li>
</xsl:if>
<xsl:if test="$post_listing_date = 'updated' or $post_listing_date = 'both'">
<xsl:if test="$show_date and $show_updated">
<li class="mobile-only">
<xsl:value-of select="/atom:feed/str:translations/str:separator"/>
</li>
</xsl:if>
<xsl:if test="$show_updated">
<li class="date">
<xsl:variable name="update_string" select="/atom:feed/str:translations/str:last_updated_on"/>
<xsl:variable name="update_date" select="substring(atom:updated, 0, 11)"/>

View file

@ -9,6 +9,9 @@
<?xml-stylesheet href="{{ get_url(path='/feed_style.xsl', trailing_slash=false) | safe }}" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:base="http://purl.org/atompub/base/1.0/" xml:lang="{{ lang }}" xml:base="{{ config.base_url }}">
<str:translations xmlns:str="https://github.com/welpo/tabi">
<str:separator>
{{ config.extra.separator | default(value="•") }}
</str:separator>
<str:about_feeds>
{{- macros_translate::translate(key="about_feeds", default="This is a web feed, also known as an Atom feed. Subscribe by copying the URL from the address bar into your newsreader", language_strings=language_strings) -}}
</str:about_feeds>