This repository has been archived on 2025-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
coryd.dev-eleventy/src/includes/partials/feeds/rss.liquid

43 lines
No EOL
2 KiB
Text

<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet href="/assets/styles/feed.xsl" type="text/xsl" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<atom:link href="{{ permalink | absoluteUrl }}" rel="self" type="application/rss+xml" />
{%- assign entries = data -%}
<title><![CDATA[{{ title }}]]></title>
<description><![CDATA[{{ globals.site_description }}]]></description>
<link>{{ permalink | absoluteUrl }}</link>
<lastBuildDate>{{ 'now' | date: "%a, %d %b %Y %H:%M:%S %z" }}</lastBuildDate>
<image>
<title><![CDATA[{{ title }}]]></title>
<link>{{ permalink | absoluteUrl }}</link>
<url>{{ "https://cdn.coryd.dev" | append: globals.avatar | append: "?class=w200" }}</url>
<width>144</width>
<height>144</height>
</image>
{% for entry in entries limit: 20 -%}
{%- assign entryFeed = entry.feed -%}
{%- assign rating = entry.rating -%}
{%- capture entryTitle -%}
{{ entryFeed.title }}
{%- if entryFeed.artist and entryFeed.artist.name %} via {{ entryFeed.artist.name }}{%- endif -%}
{%- if rating %} ({{ rating }}){%- endif -%}
{%- endcapture -%}
{%- assign utm_parameters = "utm_source=rss&utm_medium=feed&utm_campaign=" | append: utm_campaign -%}
<item>
<title><![CDATA[{{ entryTitle }}]]></title>
{%- if utm_campaign -%}
<link>{{ entryFeed.url | append: '?' | append: utm_parameters | encodeAmp }}</link>
{%- else -%}
<link>{{ entryFeed.url | encodeAmp }}</link>
{%- endif -%}
<pubDate>{{ entryFeed.date | stringToRFC822Date }}</pubDate>
<guid isPermaLink="false">{{ entryFeed.url | encodeAmp }}</guid>
{%- if entryFeed.image -%}
<enclosure url="https://cdn.coryd.dev{{ entryFeed.image }}?class=w800" type="image/jpeg" />
{%- endif -%}
<description><![CDATA[{{ entryFeed.description | escape | markdown }}]]></description>
</item>
{%- endfor %}
</channel>
</rss>