From 7934cc3581511de611059e542071a83cb01b248a Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sat, 10 Aug 2024 14:32:59 -0700 Subject: [PATCH] feat: formatted + cleaned up feeds --- config/collections/index.js | 4 +- config/filters/index.js | 2 +- package-lock.json | 4 +- package.json | 2 +- src/assets/styles/feed.xsl | 332 +++++++++++++++++++++++++ src/includes/partials/feeds/rss.liquid | 16 +- src/pages/feeds/json/all.liquid | 4 +- src/pages/feeds/json/books.liquid | 4 +- src/pages/feeds/json/feed.liquid | 4 +- src/pages/feeds/json/links.liquid | 4 +- src/pages/feeds/json/movies.liquid | 4 +- src/pages/feeds/rss/all.liquid | 4 +- src/pages/feeds/rss/books.liquid | 4 +- src/pages/feeds/rss/feed.liquid | 4 +- src/pages/feeds/rss/links.liquid | 4 +- src/pages/feeds/rss/movies.liquid | 4 +- 16 files changed, 367 insertions(+), 33 deletions(-) create mode 100644 src/assets/styles/feed.xsl diff --git a/config/collections/index.js b/config/collections/index.js index b8c518ba..ce105be0 100644 --- a/config/collections/index.js +++ b/config/collections/index.js @@ -110,9 +110,9 @@ export const processContent = (collection) => { // link to artist concerts section if available - artistUrl is only present on concert objects here if (item?.['artistUrl']) content['url'] = `${item['artistUrl']}#concerts` if (item?.['description']) { - content['description'] = `${item['description'].split(' ').slice(0, 25).join(' ')}...

` + content['description'] = `${item['description'].split(' ').slice(0, 25).join(' ')}...` } else if (item?.['notes']) { - content['notes'] = `${item['notes'].split(' ').slice(0, 25).join(' ')}...

` + content['notes'] = `${item['notes'].split(' ').slice(0, 25).join(' ')}...` } else { content['description'] = '' } diff --git a/config/filters/index.js b/config/filters/index.js index d4ef5507..d90d0c2a 100644 --- a/config/filters/index.js +++ b/config/filters/index.js @@ -131,7 +131,7 @@ export default { url = entry.link } if (entry.description) excerpt = entry.description - if (entry.type === 'book' || entry.type === 'movie' || entry.type === 'link') excerpt = `${entry.description}

` + if (entry.type === 'book' || entry.type === 'movie' || entry.type === 'link') excerpt = `${entry.description}` if (entry?.slug && entry.content) excerpt = sanitizeHtml(`${md.render(entry.content)}${feedNote}`, { disallowedTagsMode: 'completelyDiscard' }) diff --git a/package-lock.json b/package-lock.json index c0035355..9adb1318 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "coryd.dev", - "version": "21.8.2", + "version": "21.9.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coryd.dev", - "version": "21.8.2", + "version": "21.9.0", "license": "MIT", "dependencies": { "@cdransf/api-text": "^1.4.0", diff --git a/package.json b/package.json index 5eb51595..f765fa6f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coryd.dev", - "version": "21.8.2", + "version": "21.9.0", "description": "The source for my personal site. Built using 11ty (and other tools).", "type": "module", "scripts": { diff --git a/src/assets/styles/feed.xsl b/src/assets/styles/feed.xsl new file mode 100644 index 00000000..faa161d8 --- /dev/null +++ b/src/assets/styles/feed.xsl @@ -0,0 +1,332 @@ + + + + + + + <xsl:value-of select="/rss/channel/title"/> + + + + + +
+
+
+

+
+
+

+

View more of the feeds from my site. Or subscribe by adding the URL below to your feed reader of choice.

+

+

+                  
+                
+

+
+
+ +
+

Published:

+

+ + + + + + +

+ +
+
+
+
+
+
+ + +
+
\ No newline at end of file diff --git a/src/includes/partials/feeds/rss.liquid b/src/includes/partials/feeds/rss.liquid index 4a72b6f1..4c3a9b0f 100644 --- a/src/includes/partials/feeds/rss.liquid +++ b/src/includes/partials/feeds/rss.liquid @@ -1,31 +1,33 @@ + + {{ permalink | absoluteUrl: globals.url }} {%- assign entries = data | normalizeEntries: 20 -%} - {{ title }} - {{ description }} + <![CDATA[{{ title }}]]> + {{ permalink | absoluteUrl: globals.url }} {{ updated | stringToRFC822Date }} - {{ title }} + <![CDATA[{{ title }}]]> {{ permalink | absoluteUrl: globals.url }} - https://cdn.coryd.dev/{{ globals.feed_image }}?class=w200&v={% appVersion %} + {{ "https://cdn.coryd.dev/" | append: globals.feed_image | append: "?class=w200&v=" | append: appVersion }} 144 144 {% for entry in entries -%} {%- assign rating = entry.rating -%} {%- capture entryTitle -%} - {{ entry.title | escape }} + {{ entry.title }} {%- if entry.authors %} via {{ entry.authors.name }}{%- endif -%} {%- if rating %} ({{ rating }}){%- endif -%} {%- endcapture -%} - {{ entryTitle }} + <![CDATA[{{ entryTitle }}]]> {{ entry.url | encodeAmp }} {{ entry.date | stringToRFC822Date }} - {{ entry.url | encodeAmp }} + {{ entry.url | encodeAmp }} {{ entry.excerpt | escape }} {%- endfor %} diff --git a/src/pages/feeds/json/all.liquid b/src/pages/feeds/json/all.liquid index 47c39bf0..3cf0f9a5 100644 --- a/src/pages/feeds/json/all.liquid +++ b/src/pages/feeds/json/all.liquid @@ -5,8 +5,8 @@ permalink: "/feeds/all.json" --- {% render "partials/feeds/json.liquid" permalink:"/feeds/all" - title:"Cory Dransfeldt: all activity" - description:"All of the posts and activity from my site." + title:"All activity / Cory Dransfeldt" + description:globals.site_description data:collections.allContent updated:collections.allContent[0].date site:site diff --git a/src/pages/feeds/json/books.liquid b/src/pages/feeds/json/books.liquid index 5154477c..83f07feb 100644 --- a/src/pages/feeds/json/books.liquid +++ b/src/pages/feeds/json/books.liquid @@ -6,8 +6,8 @@ permalink: "/feeds/books.json" {%- assign bookData = books.all | bookStatus: 'finished' | bookSortDescending -%} {% render "partials/feeds/json.liquid" permalink:"/feeds/books" - title:"Cory Dransfeldt: books" - description:"Books I'm currently reading." + title:"Books / Cory Dransfeldt" + description:globals.site_description data:bookData updated:bookData[0].date site:site diff --git a/src/pages/feeds/json/feed.liquid b/src/pages/feeds/json/feed.liquid index b6f4c28a..48aa4722 100644 --- a/src/pages/feeds/json/feed.liquid +++ b/src/pages/feeds/json/feed.liquid @@ -5,8 +5,8 @@ permalink: "/feeds/posts.json" --- {% render "partials/feeds/json.liquid" permalink:"/feeds/posts" - title:"Cory Dransfeldt" - description:"Posts from my site." + title:"Posts / Cory Dransfeldt" + description:globals.site_description data:posts updated:posts[0].date site:site diff --git a/src/pages/feeds/json/links.liquid b/src/pages/feeds/json/links.liquid index 2862bee5..5b6ef3bf 100644 --- a/src/pages/feeds/json/links.liquid +++ b/src/pages/feeds/json/links.liquid @@ -5,8 +5,8 @@ permalink: "/feeds/links.json" --- {% render "partials/feeds/json.liquid" permalink:"/feeds/links" - title:"Cory Dransfeldt: links" - description:"Links I've liked." + title:"Links / Cory Dransfeldt" + description:globals.site_description data:links updated:links[0].date site:site diff --git a/src/pages/feeds/json/movies.liquid b/src/pages/feeds/json/movies.liquid index 5b3f99df..21c0018b 100644 --- a/src/pages/feeds/json/movies.liquid +++ b/src/pages/feeds/json/movies.liquid @@ -5,8 +5,8 @@ permalink: "/feeds/movies.json" --- {% render "partials/feeds/json.liquid" permalink:"/feeds/movies" - title:"Cory Dransfeldt: movies" - description:"Movies I've watched recently." + title:"Movies / Cory Dransfeldt" + description:globals.site_description data:movies.recentlyWatched updated:movies.recentlyWatched[0].lastWatched site:site diff --git a/src/pages/feeds/rss/all.liquid b/src/pages/feeds/rss/all.liquid index 5d2f2822..f0b7a4a9 100644 --- a/src/pages/feeds/rss/all.liquid +++ b/src/pages/feeds/rss/all.liquid @@ -5,8 +5,8 @@ permalink: "/feeds/all" --- {% render "partials/feeds/rss.liquid" permalink:"/feeds/all" - title:"Cory Dransfeldt: all activity" - description:"All of the posts and activity from my site." + title:"All activity / Cory Dransfeldt" + description:globals.site_description data:collections.allContent updated:collections.allContent[0].date site:site diff --git a/src/pages/feeds/rss/books.liquid b/src/pages/feeds/rss/books.liquid index 480f1fde..503494ac 100644 --- a/src/pages/feeds/rss/books.liquid +++ b/src/pages/feeds/rss/books.liquid @@ -6,8 +6,8 @@ permalink: "/feeds/books" {%- assign bookData = books.all | bookStatus: 'finished' | bookSortDescending -%} {% render "partials/feeds/rss.liquid" permalink:"/feeds/books" - title:"Cory Dransfeldt: books" - description:"Books I'm currently reading." + title:"Books / Cory Dransfeldt" + description:globals.site_description data:bookData updated:bookData[0].date site:site diff --git a/src/pages/feeds/rss/feed.liquid b/src/pages/feeds/rss/feed.liquid index 3cb3dfad..9ceee394 100644 --- a/src/pages/feeds/rss/feed.liquid +++ b/src/pages/feeds/rss/feed.liquid @@ -5,8 +5,8 @@ permalink: "/feeds/posts" --- {% render "partials/feeds/rss.liquid" permalink:"/feeds/posts" - title:"Cory Dransfeldt" - description:"Posts from my site." + title:"Posts / Cory Dransfeldt" + description:globals.site_description data:posts updated:posts[0].date site:site diff --git a/src/pages/feeds/rss/links.liquid b/src/pages/feeds/rss/links.liquid index b7554534..6e68867f 100644 --- a/src/pages/feeds/rss/links.liquid +++ b/src/pages/feeds/rss/links.liquid @@ -5,8 +5,8 @@ permalink: "/feeds/links" --- {% render "partials/feeds/rss.liquid" permalink:"/feeds/links" - title:"Cory Dransfeldt: links" - description:"Links I've liked." + title:"Links / Cory Dransfeldt" + description:globals.site_description data:links updated:links[0].date site:site diff --git a/src/pages/feeds/rss/movies.liquid b/src/pages/feeds/rss/movies.liquid index ab2e711a..5275c606 100644 --- a/src/pages/feeds/rss/movies.liquid +++ b/src/pages/feeds/rss/movies.liquid @@ -5,8 +5,8 @@ permalink: "/feeds/movies" --- {% render "partials/feeds/rss.liquid" permalink:"/feeds/movies" - title:"Cory Dransfeldt: movies" - description:"Movies I've watched recently." + title:"Movies / Cory Dransfeldt" + description:globals.site_description data:movies.recentlyWatched updated:movies.recentlyWatched[0].lastWatched site:site