A pack of Eleventy plugins for generating an RSS feed.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
sample
src Add error if base is not in play. Feb 1, 2018
test
.editorconfig
.eleventy.js
.eleventyignore
.gitignore First commit, migrates this code from `eleventy-base-blog` Jan 28, 2018
LICENSE
README.md
package.json

README.md

eleventy-plugins-rss

A pack of Eleventy plugins for generating an RSS feed using the Nunjucks templating engine.

Installation

Available on npm.

npm install @11ty/eleventy-plugin-rss --save

Open up your Eleventy config file (probably .eleventy.js) and use addPlugin:

const pluginRss = require("@11ty/eleventy-plugin-rss");
module.exports = function(eleventyConfig) {
  eleventyConfig.addPlugin(pluginRss);
};

Read more about Eleventy plugins.

Usage

See sample/feed.njk for an example RSS (actually Atom ¯\_(ツ)_/¯) feed template.

Supplies: Nunjucks Filters

  • rssLastUpdatedDate: Gets the most recently updated content in the collection and retrieves the properly formatted Date for the top-level <updated> element.
  • rssDate: format a Date to be used for individual <entry><updated> elements.
  • absoluteUrl: converts a single URL (relative or absolute path) to a full absolute URL including protocol, domain, full path.
  • htmlToAbsoluteUrls: transforms all of the URLs in a block of HTML with absoluteUrl above. Uses posthtml-urls with a[href], video[src], audio[src], source, img[src], [srcset] and a whole bunch more.