1
1
Fork 0

rss feed, fix blog header link

This commit is contained in:
Ava Gaiety W 2025-07-08 22:26:17 -06:00
parent cb9a4158cc
commit ba690649c0
5 changed files with 69 additions and 4 deletions

View file

@ -10,6 +10,7 @@ const markdownitClass = require('@toycode/markdown-it-class');
const markdownitImageFigures = require('markdown-it-image-figures');
const anchor = require('markdown-it-anchor');
const cheerio = require('cheerio');
const { feedPlugin } = require("@11ty/eleventy-plugin-rss");
const expectedInputFormat = 'YYYY-MM-DD';
const defaultOuputFormat = 'LL';
@ -71,6 +72,26 @@ module.exports = function (eleventyConfig) {
new Nunjucks.FileSystemLoader("_includes")
);
eleventyConfig.addPlugin(feedPlugin, {
type: "rss",
outputPath: "/blog/rss",
collection: {
name: "posts",
limit: 0,
},
metadata: {
language: 'en',
title: 'Gaiet\'s Blog',
subtitle: 'Various writings on code, design, art and life.',
base: 'https://gaiety.me/blog',
author: {
name: 'Ava Gaiety W.',
email: 'ava+blog@wroten.me',
}
}
})
eleventyConfig.configureErrorReporting({ allowMissingExtensions: true })
eleventyConfig.setLibrary('md', md);
eleventyConfig.addPassthroughCopy('assets');

View file

@ -6,7 +6,12 @@
<h1 class="my-2 text-5xl tracking-tight fancy-heading inline-block motion-safe:animate-fade-right">
<span class="font-serif">{{ title }}</span>
<small class="inline-block h-1 mt-0 text-xl text-text font-light">
in <a href="/{{tags[0]}}" class="link">{{ tags[0] | capitalize }}</a>
in
{% if '/blog' in page.url %}
<a href="/blog" class="link">Blog</a>
{% else %}
<a href="/{{tags[0]}}" class="link">{{ tags[0] | capitalize }}</a>
{% endif %}
</small>
</h1>
</div>
@ -18,6 +23,12 @@
<div class="p-4 sm:p-6 contrast-more:contrast-150">
{{ content | safe }}
</div>
{% if '/blog' in page.url %}
<hr class="border-yellow" />
<footer class="p-4 pt-0 sm:p-6 sm:pt-2 contrast-more:contrast-150 text-text">
Thanks for reading! This blog has a <a href="/blog/rss" rel="me" class="link">RSS feed</a> if you'd like to stay up to date.
</footer>
{% endif %}
</div>
</main>

View file

@ -1,7 +1,7 @@
---
layout: blog-list.njk
description:
Various writings on code, design, art and life.
Various writings on code, design, art and life. [RSS](/blog/rss)
eleventyExcludeFromCollections: true
---

32
package-lock.json generated
View file

@ -10,6 +10,7 @@
"license": "ISC",
"devDependencies": {
"@11ty/eleventy": "^3.0.0",
"@11ty/eleventy-plugin-rss": "^2.0.4",
"@11ty/eleventy-plugin-syntaxhighlight": "^3.1.3",
"@catppuccin/highlightjs": "^1.0.1",
"@catppuccin/tailwindcss": "^0.1.6",
@ -185,6 +186,37 @@
"url": "https://opencollective.com/11ty"
}
},
"node_modules/@11ty/eleventy-plugin-rss": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/@11ty/eleventy-plugin-rss/-/eleventy-plugin-rss-2.0.4.tgz",
"integrity": "sha512-LF60sGVlxGTryQe3hTifuzrwF8R7XbrNsM2xfcDcNMSliLN4kmB+7zvoLRySRx0AQDjqhPTAeeeT0ra6/9zHUQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@11ty/eleventy-utils": "^2.0.0",
"@11ty/posthtml-urls": "^1.0.1",
"debug": "^4.4.0",
"posthtml": "^0.16.6"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/11ty"
}
},
"node_modules/@11ty/eleventy-plugin-rss/node_modules/@11ty/eleventy-utils": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/@11ty/eleventy-utils/-/eleventy-utils-2.0.7.tgz",
"integrity": "sha512-6QE+duqSQ0GY9rENXYb4iPR4AYGdrFpqnmi59tFp9VrleOl0QSh8VlBr2yd6dlhkdtj7904poZW5PvGr9cMiJQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/11ty"
}
},
"node_modules/@11ty/eleventy-plugin-syntaxhighlight": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/@11ty/eleventy-plugin-syntaxhighlight/-/eleventy-plugin-syntaxhighlight-3.2.2.tgz",

View file

@ -30,6 +30,7 @@
},
"devDependencies": {
"@11ty/eleventy": "^3.0.0",
"@11ty/eleventy-plugin-rss": "^2.0.4",
"@11ty/eleventy-plugin-syntaxhighlight": "^3.1.3",
"@catppuccin/highlightjs": "^1.0.1",
"@catppuccin/tailwindcss": "^0.1.6",