diff --git a/eleventy.config.js b/eleventy.config.js index a9549cf..b92fa7f 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -1,4 +1,5 @@ import pugPlugin from "@11ty/eleventy-plugin-pug"; +import rssPlugin from "@11ty/eleventy-plugin-rss"; import brokenLinksPlugin from "eleventy-plugin-broken-links"; import { eleventyImageTransformPlugin } from "@11ty/eleventy-img"; import syntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight"; @@ -10,6 +11,7 @@ export default function (eleventyConfig) { eleventyConfig.setInputDirectory("src") eleventyConfig.addPlugin(brokenLinksPlugin); eleventyConfig.addPlugin(pugPlugin); + eleventyConfig.addPlugin(rssPlugin); eleventyConfig.addPlugin(syntaxHighlight); eleventyConfig.addPlugin(eleventyImageTransformPlugin, { htmlOptions: { diff --git a/package.json b/package.json index 5a6a840..1d33efb 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@11ty/eleventy": "^3.0.0", "@11ty/eleventy-img": "^6.0.1", "@11ty/eleventy-plugin-pug": "^1.0.0", + "@11ty/eleventy-plugin-rss": "^2.0.3", "@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0", "eleventy-plugin-broken-links": "^2.2.1", "opml": "^0.5.7" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d4380ae..00660ca 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ importers: '@11ty/eleventy-plugin-pug': specifier: ^1.0.0 version: 1.0.0 + '@11ty/eleventy-plugin-rss': + specifier: ^2.0.3 + version: 2.0.3 '@11ty/eleventy-plugin-syntaxhighlight': specifier: ^5.0.0 version: 5.0.0 @@ -60,6 +63,9 @@ packages: resolution: {integrity: sha512-7o9SQqbHfiIctfvWpbP6tibzM1R5YnC97yrMn8r8nPGA3umGbbSMUFr9sx4lepLbfzqd21svhq9X3SJRhj4xpg==} engines: {node: '>=18'} + '@11ty/eleventy-plugin-rss@2.0.3': + resolution: {integrity: sha512-ubK97uahCLpKhORLfblgxLcoaNqTcKde1cH8CeRKNTFoUuuDSEjWZtodV9fKrg+uOp5X74dO43z1/io6hhs5Bw==} + '@11ty/eleventy-plugin-syntaxhighlight@5.0.0': resolution: {integrity: sha512-y9BUmP1GofmbJgxM1+ky/UpFCpD8JSOeLeKItUs0WApgnrHk9haHziW7lS86lbArX5SiCVo4zTTw9x53gvRCaA==} @@ -1469,6 +1475,15 @@ snapshots: transitivePeerDependencies: - supports-color + '@11ty/eleventy-plugin-rss@2.0.3': + dependencies: + '@11ty/eleventy-utils': 2.0.1 + '@11ty/posthtml-urls': 1.0.1 + debug: 4.4.0 + posthtml: 0.16.6 + transitivePeerDependencies: + - supports-color + '@11ty/eleventy-plugin-syntaxhighlight@5.0.0': dependencies: prismjs: 1.30.0 diff --git a/src/blog/feeds/atom.xml.njk b/src/blog/feeds/atom.xml.njk new file mode 100644 index 0000000..175efe7 --- /dev/null +++ b/src/blog/feeds/atom.xml.njk @@ -0,0 +1,47 @@ +--- +permalink: /blog/atom.xml +eleventyExcludeFromCollections: true +metadata: + title: "Garrett's Blog" + description: "Write-ups and musings by Garrett Mills, often technical, sometimes not." + language: en + base: "https://garrettmills.dev" + author: + name: "Garrett Mills" + email: "shout@garrettmills.dev" +--- + + + + {{ metadata.base }}/#about + {{ metadata.title }} + {{ collections.blog | getNewestCollectionItemDate | dateToRfc3339 }} + + {{ metadata.author.name }} + {{ metadata.author.email }} + {{ metadata.base }}/#about + + + + {{ metadata.description }} + {{ metadata.base }}/assets/favicon/apple-touch-icon.png + {{ metadata.base }}/assets/favicon/favicon.ico + Copyright (c) 2025 Garrett Mills. See website for licensing details. + + + {%- for post in collections.blog %} + {%- set absolutePostUrl = post.url | htmlBaseUrl(metadata.base) %} + + <![CDATA[{{ post.data.title }}]]> + {{ absolutePostUrl }} + + {{ post.date | dateToRfc3339 }} + + {{ metadata.author.name }} + {{ metadata.author.email }} + {{ metadata.base }}/#about + + {{ post.content | renderTransforms(post.data.page, metadata.base) }} + + {%- endfor %} + \ No newline at end of file diff --git a/src/blog/feeds/json.json.njk b/src/blog/feeds/json.json.njk new file mode 100644 index 0000000..f0435cb --- /dev/null +++ b/src/blog/feeds/json.json.njk @@ -0,0 +1,45 @@ +--- +permalink: /blog/json.json +eleventyExcludeFromCollections: true +metadata: + title: "Garrett's Blog" + description: "Write-ups and musings by Garrett Mills, often technical, sometimes not." + language: en + base: "https://garrettmills.dev" + author: + name: "Garrett Mills" + email: "shout@garrettmills.dev" +--- +{ + "version": "https://jsonfeed.org/version/1.1", + "title": "{{ metadata.title }}", + "language": "{{ metadata.language }}", + "home_page_url": "{{ metadata.base | addPathPrefixToFullUrl }}", + "feed_url": "{{ permalink | htmlBaseUrl(metadata.base) }}", + "description": "{{ metadata.description }}", + "icon": "{{ metadata.base }}/assets/favicon/apple-touch-icon.png", + "authors": [ + { + "name": "{{ metadata.author.name }}", + "url": "{{ metadata.base }}/#about" + } + ], + "items": [ + {%- for post in collections.blog %} + {%- set absolutePostUrl %}{{ post.url | htmlBaseUrl(metadata.base) }}{% endset %} + { + "id": "{{ absolutePostUrl }}", + "url": "{{ absolutePostUrl }}", + "title": "{{ post.data.title }}", + "content_html": {% if post.content %}{{ post.content | renderTransforms(post.data.page, metadata.base) | dump | safe }}{% else %}""{% endif %}, + "date_published": "{{ post.date | dateToRfc3339 }}", + "date_modified": "{{ post.date | dateToRfc3339 }}", + "author": { + "name": "{{ metadata.author.name }}", + "url": "{{ metadata.base }}/#about" + } + } + {% if not loop.last %},{% endif %} + {%- endfor %} + ] +} \ No newline at end of file diff --git a/src/blog/feeds/obsidian.xsl.njk b/src/blog/feeds/obsidian.xsl.njk new file mode 100644 index 0000000..e38bff7 --- /dev/null +++ b/src/blog/feeds/obsidian.xsl.njk @@ -0,0 +1,119 @@ +--- +permalink: /blog/feed.xsl +--- + + + + + + + <xsl:value-of select="/rss/channel/title"/> + <xsl:value-of select="/atom:feed/atom:title"/> | Web Feed + + + + + +
+
glm.
+ +
+
+

+ This is a web feed, also known as an RSS feed. Subscribe by copying the URL from the address bar into your newsreader. + Visit About Feeds to get started with newsreaders and subscribing. It’s free. +

+
+ +
+

+ + + + + + + + + + + + + + + + + + + +

+

+

+
+

Web Feed Items

+ +
+
+ + +
+
diff --git a/src/blog/feeds/rss2.xml.njk b/src/blog/feeds/rss2.xml.njk new file mode 100644 index 0000000..7cfdcdf --- /dev/null +++ b/src/blog/feeds/rss2.xml.njk @@ -0,0 +1,47 @@ +--- +permalink: /blog/rss2.xml +eleventyExcludeFromCollections: true +metadata: + title: "Garrett's Blog" + description: "Write-ups and musings by Garrett Mills, often technical, sometimes not." + language: en + base: "https://garrettmills.dev" + author: + name: "Garrett Mills" + email: "shout@garrettmills.dev" +--- + + + + + {{ metadata.title }} + {{ metadata.base }}/blog + {{ metadata.description }} + {{ collections.blog | getNewestCollectionItemDate | dateToRfc822 }} + https://validator.w3.org/feed/docs/rss2.html + {{ metadata.language }} + + {{ metadata.title }} + {{ metadata.base }}/assets/favicon/apple-touch-icon.png + {{ metadata.base }}/blog + + Copyright (c) 2025 Garrett Mills. See website for licensing details. + Technology + Software Development + + + {%- for post in collections.blog %} + {%- set absolutePostUrl = post.url | htmlBaseUrl(metadata.base) %} + + <![CDATA[{{ post.data.title }}]]> + {{ absolutePostUrl }} + {{ absolutePostUrl }} + {{ post.date | dateToRfc822 }} + {{ metadata.author.name }} + {{ metadata.author.name }} + {{ post.content | renderTransforms(post.data.page, metadata.base) }} + {{ post.content | renderTransforms(post.data.page, metadata.base) }} + + {%- endfor %} + + \ No newline at end of file