chore: myriad feed fixes

This commit is contained in:
Cory Dransfeldt 2024-08-10 16:15:22 -07:00
parent 189c5b90d5
commit 7e55338697
No known key found for this signature in database
20 changed files with 82 additions and 59 deletions

View file

@ -1,21 +1,47 @@
{
"version": "https://jsonfeed.org/version/1",
"title": "{{ title | escape }}",
"home_page_url": "{{ permalink | absoluteUrl: globals.url | escape }}",
"feed_url": "{{ permalink | absoluteUrl: globals.url | escape }}.json",
"description": "{{ description | escape }}",
"icon": "https://cdn.coryd.dev/{{ globals.feed_image | escape }}?class=w200&v={% appVersion %}",
"favicon": "https://cdn.coryd.dev/{{ globals.favicon_ico | escape }}?class=w50&v={% appVersion %}",
"items": [
{%- assign entries = data | normalizeEntries: 20 -%}
{%- for entry in entries -%}
{
"id": "{{ entry.url | encodeAmp | escape }}",
"url": "{{ entry.url | encodeAmp | escape }}",
"title": "{{ entry.title | escape }}{%- if entry.authors %} via {{ entry.authors.name | escape }}{%- endif %}{%- if entry.rating %} ({{ entry.rating | escape }}){%- endif %}",
"content_text": "{{ entry.excerpt | escape | replace: '\"', '\\"' }}",
"date_published": "{{ entry.date | stringToRFC822Date }}"
}{% if forloop.last == false %},{% endif %}
{%- endfor %}
]
"version": "https://jsonfeed.org/version/1.1",
"title": "{{ title | escape }}",
"home_page_url": "{{ permalink | absoluteUrl | escape }}",
"feed_url": "{{ permalink | absoluteUrl | escape }}.json",
"description": "{{ globals.site_description | escape }}",
"icon": "https://cdn.coryd.dev/{{ globals.feed_image | escape }}?class=w200&v={% appVersion %}",
"favicon": "https://cdn.coryd.dev/{{ globals.favicon_ico | escape }}?class=w50&v={% appVersion %}",
"authors": [
{
"name": "{{ globals.site_name }}",
"url": "{{ globals.url | escape }}",
"avatar": "https://cdn.coryd.dev/{{ globals.avatar | escape }}?class=w200&v={% appVersion %}"
}
],
"items": [
{%- assign entries = data | normalizeEntries: 20 -%}
{%- for entry in entries -%}
{%- assign summary = entry.content | strip_html | normalize_whitespace | escape -%}
{
"id": "{{ entry.url | encodeAmp | escape }}",
"title": "{{ entry.title | escape }}{% if entry.authors %} via {{ entry.authors.name | escape }}{% endif %}{% if entry.rating %} ({{ entry.rating | escape }}){% endif %}",
"url": "{{ entry.url | encodeAmp | escape }}",
"content_html": "{{ summary }}",
"summary": "{{ summary }}",
{%- if entry.author -%}
"external_url": "{{ entry.url | encodeAmp | escape }}",
"authors": [
{
"name": "{{ entry.author.name | escape }}",
"url": "{{ entry.author.url | escape }}",
"mastodon": "{{ entry.author.mastodon | escape }}",
"rss": "{{ entry.author.feed | escape }}"
}
],
{%- endif %}
"date_published": "{{ entry.date | stringToRFC822Date }}"{%- if entry.tags -%},
"tags": [
{%- for tag in entry.tags -%}
"{{ tag | escape }}"{%- unless forloop.last -%}, {% endunless -%}
{%- endfor -%}
]
{%- endif -%}
}{%- if forloop.last == false -%},{%- endif -%}
{%- endfor -%}
]
}

View file

@ -2,16 +2,15 @@
<?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: globals.url }}" rel="self" type="application/rss+xml" />
<feedUrl>{{ permalink | absoluteUrl: globals.url }}</feedUrl>
<atom:link href="{{ permalink | absoluteUrl }}" rel="self" type="application/rss+xml" />
{%- assign entries = data | normalizeEntries: 20 -%}
<title><![CDATA[{{ title }}]]></title>
<description><![CDATA[{{ description }}]]></description>
<link>{{ permalink | absoluteUrl: globals.url }}</link>
<description><![CDATA[{{ globals.site_description }}]]></description>
<link>{{ permalink | absoluteUrl }}</link>
<lastBuildDate>{{ updated | stringToRFC822Date }}</lastBuildDate>
<image>
<title><![CDATA[{{ title }}]]></title>
<link>{{ permalink | absoluteUrl: globals.url }}</link>
<link>{{ permalink | absoluteUrl }}</link>
<url>{{ "https://cdn.coryd.dev/" | append: globals.feed_image | append: "?class=w200&amp;v=" | append: appVersion }}</url>
<width>144</width>
<height>144</height>