Support webfeeds accent color, deprecation, partial status

This commit is contained in:
~lucidiot 2023-07-22 18:25:26 +02:00
parent d6cecadaeb
commit 15977137a8
2 changed files with 46 additions and 1 deletions

View File

@ -11,6 +11,7 @@
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:webfeeds="http://webfeeds.org/rss/1.0"
>
<access:restriction relationship="allow" />
<channel>
@ -39,6 +40,9 @@
<sy:updateFrequency>1</sy:updateFrequency>
<sy:updateBase>1990-01-01T12:00+01:00</sy:updateBase>
<webfeeds:partial>false</webfeeds:partial>
<webfeeds:deprecated>false</webfeeds:deprecated>
<image>
<link>https://envs.net/~lucidiot/rsrsss/feed.xml</link>
<title>RSRSSS</title>

View File

@ -12,6 +12,7 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:webfeeds="http://webfeeds.org/rss/1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" doctype-system="about:legacy-compat" />
@ -49,8 +50,14 @@
</xsl:template>
<xsl:template match="channel">
<!-- TODO: support accent color -->
<header>
<xsl:if test="webfeeds:accentColor">
<xsl:attribute name="style">
<xsl:text>background: #</xsl:text>
<xsl:value-of select="webfeeds:accentColor" />
<xsl:text> linear-gradient(0, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);</xsl:text>
</xsl:attribute>
</xsl:if>
<xsl:if test="image">
<a href="{image/link/text()}" class="channel-logo" target="_blank">
<img src="{image/url/text()}" alt="{image/title/text()}" title="{image/description/text()}" />
@ -176,6 +183,40 @@
</dd>
</xsl:if>
<xsl:if test="webfeeds:partial">
<dt>Partial feed</dt>
<dd>
<xsl:choose>
<xsl:when test="webfeeds:partial/text() = 'true'">
<xsl:text>Yes</xsl:text>
</xsl:when>
<xsl:when test="webfeeds:partial/text() = 'false'">
<xsl:text>No</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>Invalid value</xsl:text>
</xsl:otherwise>
</xsl:choose>
</dd>
</xsl:if>
<xsl:if test="webfeeds:deprecated">
<dt>Deprecated</dt>
<dd>
<xsl:choose>
<xsl:when test="webfeeds:deprecated/text() = 'true'">
<xsl:text>Yes</xsl:text>
</xsl:when>
<xsl:when test="webfeeds:deprecated/text() = 'false'">
<xsl:text>No</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>Invalid value</xsl:text>
</xsl:otherwise>
</xsl:choose>
</dd>
</xsl:if>
<xsl:if test="/rss/access:restriction">
<dt><a href="https://web.archive.org/web/20080101062756/http://www.bloglines.com/about/specs/fac-1.0" target="_blank">Feed Access Control</a></dt>
<dd>