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

@ -102,12 +102,11 @@
<link href="https://cdn.coryd.dev/{{ globals.apple_touch_icon }}?class=w200&v={% appVersion %}" rel="apple-touch-icon">
<link rel="webmention" href="https://webmention.io/coryd.dev/webmention" />
<link rel="pingback" href="https://webmention.io/coryd.dev/xmlrpc" />
<link type="application/atom+xml" rel="alternate" title="{{ globals.site_name }}" href="https://feedpress.me/coryd">
<link rel="alternate" type="application/json" title="{{ globals.site_name }}" href="https://feedpress.me/coryd.json" />
<link rel="alternate" href="https://feedpress.me/coryd-links" title="{{ globals.site_name }}'s links feed" type="application/rss+xml">
<link rel="alternate" href="https://feedpress.me/coryd-movies" title="{{ globals.site_name }}'s movies feed" type="application/rss+xml">
<link rel="alternate" href="https://feedpress.me/coryd-books" title="{{ globals.site_name }}'s books feed" type="application/rss+xml">
<link rel="alternate" href="https://feedpress.me/coryd-all" title="{{ globals.site_name }}'s activity feed" type="application/rss+xml">
<link type="application/atom+xml" rel="alternate" title="Posts / {{ globals.site_name }}" href="https://coryd.dev/feeds/posts">
<link rel="alternate" href="https://coryd.dev/feeds/links" title="Links / {{ globals.site_name }}" type="application/rss+xml">
<link rel="alternate" href="https://coryd.dev/feeds/movies" title="Movies / {{ globals.site_name }}'s movies feed" type="application/rss+xml">
<link rel="alternate" href="https://coryd.dev/feeds/books" title="Books / {{ globals.site_name }}" type="application/rss+xml">
<link rel="alternate" href="https://coryd.dev/feeds/all" title="All activity / {{ globals.site_name }}" type="application/rss+xml">
<script defer data-domain="coryd.dev" src="/js/script.js"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
<script type="application/ld+json">

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>