From 21ab946b7405c7f18f4b385e2017f1b9098fe88b Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Tue, 19 Sep 2023 10:42:51 -0700 Subject: [PATCH] feat: link post support + style fixes + split post and link feeds --- .eleventy.js | 19 ++++++++ config/feedFilters.js | 2 +- src/404.html | 8 ++-- src/_includes/partials/feeds/layout.liquid | 4 +- src/_includes/partials/nav/linked-icon.liquid | 2 +- .../partials/now/albumReleases.liquid | 4 +- src/_includes/partials/now/media-grid.liquid | 4 +- src/_includes/partials/now/playing.liquid | 5 +-- src/_includes/partials/now/status.liquid | 5 +-- src/_includes/partials/paginator.liquid | 8 ++-- src/_includes/partials/popular-posts.liquid | 4 +- src/_includes/post.liquid | 11 ++++- src/_includes/webrings/css-joy.liquid | 6 +-- src/_includes/webrings/the-claw.liquid | 2 +- src/feeds/links.liquid | 12 ++++++ src/index.html | 29 ++++++++----- src/now.html | 43 +++++++------------ ...ng-data-from-apple-music-using-musickit.md | 6 +-- .../drying-up-now-page-templates-eleventy.md | 2 +- ...cs-to-json-surfacing-anticipated-albums.md | 4 +- ...r-posts-widget-using-eleventy-plausible.md | 4 +- tailwind.css | 28 ++---------- 22 files changed, 113 insertions(+), 99 deletions(-) create mode 100644 src/feeds/links.liquid diff --git a/.eleventy.js b/.eleventy.js index 8f91ab83..54aeab24 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -80,6 +80,25 @@ module.exports = function (eleventyConfig) { return Array.from(tagsSet).sort() }) + eleventyConfig.addCollection('links', (collection) => { + const links = [] + collection.getAll().forEach((item) => { + if (item.data.collections.posts) { + item.data.collections.posts.forEach((post) => { + const url = post.data.link + if (url?.includes('http') && !links.find((link) => link.title === post.data.title)) + links.push({ + url: post.data.link, + title: post.data.title, + date: post.data.date, + description: post.data.post_excerpt, + }) + }) + } + }) + return links + }) + eleventyConfig.addCollection('tagMap', (collection) => { const tags = {} collection.getAll().forEach((item) => { diff --git a/config/feedFilters.js b/config/feedFilters.js index d61a5efb..b5de3aea 100644 --- a/config/feedFilters.js +++ b/config/feedFilters.js @@ -13,7 +13,7 @@ module.exports = { if (entry.description) excerpt = entry.description // if there's a valid entry return a normalized object - if (entry) { + if (entry && !entry.data?.link) { return { title: entry.data?.title || entry.title, url: entry.url.includes('http') ? entry.url : new URL(entry.url, BASE_URL).toString(), diff --git a/src/404.html b/src/404.html index a3e5dec1..ea085586 100644 --- a/src/404.html +++ b/src/404.html @@ -10,11 +10,9 @@ permalink: 404.html What kind of idiots do you have working here?
- - - {% tablericon "receipt-2" "Receipt" "{width: 20, height: 20}" %} - - Skip out on the room service bill + + {% tablericon "receipt-2" "Receipt" %} + Skip out on the room service bill
diff --git a/src/_includes/partials/feeds/layout.liquid b/src/_includes/partials/feeds/layout.liquid index 6a2825f2..3b0cd30c 100644 --- a/src/_includes/partials/feeds/layout.liquid +++ b/src/_includes/partials/feeds/layout.liquid @@ -34,10 +34,10 @@

diff --git a/src/_includes/partials/nav/linked-icon.liquid b/src/_includes/partials/nav/linked-icon.liquid index b6f6b95b..210ff0fa 100644 --- a/src/_includes/partials/nav/linked-icon.liquid +++ b/src/_includes/partials/nav/linked-icon.liquid @@ -1,5 +1,5 @@ diff --git a/src/_includes/partials/now/albumReleases.liquid b/src/_includes/partials/now/albumReleases.liquid index 00c7f29c..40b1dd63 100644 --- a/src/_includes/partials/now/albumReleases.liquid +++ b/src/_includes/partials/now/albumReleases.liquid @@ -1,7 +1,7 @@ {% if albumReleases.size > 0 %} -

+

{% tablericon "calendar-time" "Anticipated albums" %} -
Anticipated albums
+ Anticipated albums