Minor Blog Updates

Quick technical update to the blog today. I added two things: RSS feeds and sitemap. Adding an RSS feed to an Eleventy site is pretty straightforward. First, one installs the RSS — Eleventy plugin. Second step is to add following to .eleventyjs:

const pluginRss = require("@11ty/eleventy-plugin-rss");

module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(pluginRss);

Final bit is to add a file somewhere inside the source tree that renders the feed xml to url /feed.xml. That file contains a skeleton structure of an Atom or RSS feed and nunjucks statements to generate individual feed items. One model can be found in the eleventy documentation RSS — Eleventy.

Adding a sitemap is even more straightforward, one just adds a nunjucks file (again, somewhere) in the project structure that renders the xml for all pages. One thing to remember is to check that none of the urls you don't want to be listed are excluded by using the eleventyExcludeFromCollections option.

One thing still missing from the features I want is the social media share images, but that change requires some design work from me and the technical implementation of the bits required to utilize the @11tyrocks/eleventy-plugin-social-images - npm.