Add an RSS feed

Fri Apr 11 2025

tucker.mcknight@gmail.com


    

37652e0e00a3789e82f4454fcad3b47d3552246c

darcs pull https://repos.tuckerm.us/repos/eleventy-darcs/branches/main -h 37652e0e00a3789e82f4454fcad3b47d3552246c
_includes/none.njk:1
Before
After
{{content | safe}}
eleventy.config.js:10
Before
After
import pluginRss from '@11ty/eleventy-plugin-rss'
eleventy.config.js:14
Before
export default function (eleventyConfig) {
After
export default (eleventyConfig) => {
eleventy.config.js:91
Before
};
After

  eleventyConfig.addPlugin(pluginRss)
}
feed.njk:1
Before
After
---
pagination:
  data: repos
  size: 1
  alias: repo
permalink: "repos/{{repo | slugify }}/patches.xml"
eleventyExcludeFromCollections: true
metadata:
  title: My Blog about Boats
  description: I am writing about my experiences as a naval navel-gazer.
  language: en
  author:
    name: Boaty McBoatFace
layout: none
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ metadata.language or page.lang }}">
  <title>Latest patches in {{repo}}</title>
  <link href="{{ ('/repos/' + (repo | slugify) + '/patches.xml')| htmlBaseUrl(darcsConfig.baseUrl) }}" rel="self" />
  <link href="{{ ('/repos/' + (repo | slugify)) | htmlBaseUrl(darcsConfig.baseUrl) }}" />
  {% set lastPatch = repos[repo].patches | last %}
  <updated>{{ lastPatch.date | date }}</updated>
  <id>{{ darcsConfig.baseUrl | addPathPrefixToFullUrl }}</id>
  <author>
    <name>{{repo}} contributors</name>
  </author>
  {%- for patch in repos[repo].patches | reverse %}
  {%- set absolutePostUrl %}{{ ('/repos/' + repo + '/patches/' + patch.hash) | htmlBaseUrl(darcsConfig.baseUrl) }}{% endset %}
  <entry>
    <title>{{ patch.name }}</title>
    <author>{{ patch.author }}</author>
    <link href="{{ absolutePostUrl }}" />
    <updated>{{ patch.date | date }}</updated>
    <id>{{ absolutePostUrl }}</id>
    <content type="html">{{ patch.description | renderTransforms({}, metadata.base) }}</content>
  </entry>
  {%- endfor %}
</feed>
package-lock.json:12
Before
After
        "@11ty/eleventy-plugin-rss": "^2.0.3",
package-lock.json:141
Before
After
      "engines": {
        "node": ">=18"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/11ty"
      }
    },
    "node_modules/@11ty/eleventy-plugin-rss": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/@11ty/eleventy-plugin-rss/-/eleventy-plugin-rss-2.0.3.tgz",
      "integrity": "sha512-ubK97uahCLpKhORLfblgxLcoaNqTcKde1cH8CeRKNTFoUuuDSEjWZtodV9fKrg+uOp5X74dO43z1/io6hhs5Bw==",
      "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.1",
      "resolved": "https://registry.npmjs.org/@11ty/eleventy-utils/-/eleventy-utils-2.0.1.tgz",
      "integrity": "sha512-hicG0vPyqfLvgHJQLtoh3XAj6wUbLX4yY2se8bQLdhCIcxK46mt4zDpgcrYVP3Sjx4HPifQOdwRfOEECoUcyXQ==",
package.json:13
Before
After
    "@11ty/eleventy-plugin-rss": "^2.0.3",
repo.njk:41
Before
            <a href="#" class="initialism">RSS<i class="bi bi-rss-fill ms-2" style="color: orange;"></i></a>
After
            <a href="/repos/{{ repo }}/patches.xml" class="initialism">RSS<i class="bi bi-rss-fill ms-2" style="color: orange;"></i></a>