From 5c0a183a1d830479e4cfc705bdc9f13b2b1efac2 Mon Sep 17 00:00:00 2001 From: Starfall Date: Tue, 23 May 2023 12:14:00 -0500 Subject: feature: atom feed - add atom feed - add theme-colored feed icon to /blog/ --- _includes/base.njk | 17 ++++++++++++----- eleventy.config.js | 3 +++ img/feed-icon.svg | 17 +++++++++++++++++ package-lock.json | 27 +++++++++++++++++++++++++++ package.json | 1 + src/blog.njk | 14 ++++++++++++++ src/feed.njk | 38 ++++++++++++++++++++++++++++++++++++++ 7 files changed, 112 insertions(+), 5 deletions(-) create mode 100755 img/feed-icon.svg create mode 100644 src/feed.njk diff --git a/_includes/base.njk b/_includes/base.njk index 6ff7553..a11c22c 100644 --- a/_includes/base.njk +++ b/_includes/base.njk @@ -3,11 +3,16 @@ title = "Starfall" --- -{{ title }} - - - - + + {{ title }} + + + + + {{ extraHeadContent | safe }} + + +
@@ -30,3 +35,5 @@ title = "Starfall"
⋁/⋀
+ + diff --git a/eleventy.config.js b/eleventy.config.js index 36722b2..a33d908 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -1,5 +1,6 @@ const toml = require('@iarna/toml') const eleventyNavigation = require('@11ty/eleventy-navigation') +const eleventyRss = require('@11ty/eleventy-plugin-rss') filter_local_date = function(date) { // yyyy-MM-dd @@ -17,8 +18,10 @@ filter_rfc3339_datetime = function(date) { module.exports = function(eleventyConfig) { eleventyConfig.addPlugin(eleventyNavigation) + eleventyConfig.addPlugin(eleventyRss) eleventyConfig.addPassthroughCopy('./css/') + eleventyConfig.addPassthroughCopy('./img/') eleventyConfig.addFilter('local_date', filter_local_date) eleventyConfig.addFilter('rfc3339_datetime', filter_rfc3339_datetime) diff --git a/img/feed-icon.svg b/img/feed-icon.svg new file mode 100755 index 0000000..0585d8a --- /dev/null +++ b/img/feed-icon.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/package-lock.json b/package-lock.json index 32621d8..15f332c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "devDependencies": { "@11ty/eleventy": "^2.0.1", "@11ty/eleventy-navigation": "^0.3.5", + "@11ty/eleventy-plugin-rss": "^1.2.0", "@iarna/toml": "^3.0.0" } }, @@ -117,6 +118,21 @@ "url": "https://opencollective.com/11ty" } }, + "node_modules/@11ty/eleventy-plugin-rss": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@11ty/eleventy-plugin-rss/-/eleventy-plugin-rss-1.2.0.tgz", + "integrity": "sha512-YzFnSH/5pObcFnqZ2sAQ782WmpOZHj1+xB9ydY/0j7BZ2jUNahn53VmwCB/sBRwXA/Fbwwj90q1MLo01Ru0UaQ==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "posthtml": "^0.16.6", + "posthtml-urls": "1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/11ty" + } + }, "node_modules/@11ty/eleventy-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@11ty/eleventy-utils/-/eleventy-utils-1.0.1.tgz", @@ -2453,6 +2469,17 @@ "dependency-graph": "^0.11.0" } }, + "@11ty/eleventy-plugin-rss": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@11ty/eleventy-plugin-rss/-/eleventy-plugin-rss-1.2.0.tgz", + "integrity": "sha512-YzFnSH/5pObcFnqZ2sAQ782WmpOZHj1+xB9ydY/0j7BZ2jUNahn53VmwCB/sBRwXA/Fbwwj90q1MLo01Ru0UaQ==", + "dev": true, + "requires": { + "debug": "^4.3.4", + "posthtml": "^0.16.6", + "posthtml-urls": "1.0.0" + } + }, "@11ty/eleventy-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@11ty/eleventy-utils/-/eleventy-utils-1.0.1.tgz", diff --git a/package.json b/package.json index efdc36e..e680afa 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "devDependencies": { "@11ty/eleventy": "^2.0.1", "@11ty/eleventy-navigation": "^0.3.5", + "@11ty/eleventy-plugin-rss": "^1.2.0", "@iarna/toml": "^3.0.0" } } diff --git a/src/blog.njk b/src/blog.njk index 4d8dfab..87cf12a 100644 --- a/src/blog.njk +++ b/src/blog.njk @@ -1,5 +1,6 @@ --- layout = "base.njk" +extraHeadContent = "" [pagination] data = "collections.post" @@ -11,6 +12,18 @@ reverse = true key = "Blog" order = 1 --- + + {% for post in posts %} {% endfor %} + diff --git a/src/feed.njk b/src/feed.njk new file mode 100644 index 0000000..d1a9c0a --- /dev/null +++ b/src/feed.njk @@ -0,0 +1,38 @@ +--- +permalink = "feed.xml" + +[metadata] +name = "devin & Alex Starfall" +email = "us@starfall.systems" +baseurl = "https://starfall.systems/" +blogurl = "https://starfall.systems/blog/" +--- + + + Starfall's Blog + + + {{ collections.post | getNewestCollectionItemDate | dateToRfc3339 }} + {{ metadata.baseurl }} + + + {{ metadata.name }} + {{ metadata.email }} + + +{% for post in collections.post | reverse %} +{%- set absolutePostUrl = post.url | absoluteUrl(metadata.baseurl) %} + + {{ post.data.title }} + {{ post.date | dateToRfc3339 }} + + {{ absolutePostUrl }} + {%- if post.data.page.excerpt %} + {{- post.data.page.excerpt -}} + {% endif -%} + + {{- post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) -}} + + +{% endfor %} + -- cgit