From 8f44ce9bddc3f5083a4df63c69f362808d1f8636 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sat, 12 Oct 2024 07:32:24 -0700 Subject: [PATCH] fix: json feed output --- config/filters/media.js | 7 +------ src/includes/partials/feeds/json.liquid | 3 ++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/config/filters/media.js b/config/filters/media.js index d7db2a5e..ff222f9b 100644 --- a/config/filters/media.js +++ b/config/filters/media.js @@ -97,10 +97,5 @@ export default { return `${allButLast} and ${last}` }, - formatVenue: (venue) => venue.split(',')[0].trim(), - lastWatchedEpisode: (episodes) => { - if (!episodes.length) return - const sortedEpisodes = episodes.sort((a, b) => new Date(a.last_watched_at) - new Date(b.last_watched_at)) - return `S${sortedEpisodes[sortedEpisodes.length - 1]['season_number']}E${sortedEpisodes[sortedEpisodes.length - 1]['episode_number']}` - } + formatVenue: (venue) => venue.split(',')[0].trim() } \ No newline at end of file diff --git a/src/includes/partials/feeds/json.liquid b/src/includes/partials/feeds/json.liquid index 255ec952..82192a8e 100644 --- a/src/includes/partials/feeds/json.liquid +++ b/src/includes/partials/feeds/json.liquid @@ -16,7 +16,8 @@ { "id": "{{ entry.feed.url | encodeAmp }}", "url": "{{ entry.feed.url | encodeAmp }}", - "title": "{{ entry.feed.title }}", + "title": "{{ entry.feed.title | escape }}", + "content_text": "{{ entry.feed.description | markdown | strip_html | escape| normalize_whitespace | rstrip | truncatewords: 50, '...' }}", "date_published": "{{ entry.feed.date | stringToRFC3339 }}" }{%- if forloop.last == false -%},{%- endif -%} {%- endfor -%}