Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including metalsmith-feed-atom with all npm packages installed. Try it out:

var metalsmithFeedAtom = require("metalsmith-feed-atom")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

metalsmith-feed-atom v1.0.0

A metalsmith plugin to generate Atom feeds.


A metalsmith plugin to generate Atom feed for a collection.
If you're looking for RSS standard instead of Atom, take a look on metalsmith-feed plugin.

Requires metalsmith-collections plugin to work.


const metalsmith = require('metalsmith');
const collections = require('metalsmith-collections');
const atomfeed = require('metalsmith-feed-atom');

  .use(collections({articles: '*.html'}))
  .use(atomfeed({collection: 'articles'})) // make sure it comes after collections


  • collection string required: Name of the configured metalsmith-collection to build the feed from.
  • limit number optional: Maximum number of files to show in the feed. Defaults to 10.
  • destination string optional: File path to write the rendered XML feed. Defaults to 'index.xml'.
  • metadata object optional: Metadata containing important information about your feed. Despite it isn't a required option, you must provide it in order to generate a valid Atom feed.
    • metadata.title string required: Title of your site/feed.
    • metadata.subtitle string optional: Subtitle of your site/feed.
    • metadata.url string required: Url of your site. This is also used as base url to produce files (feed entries) urls.
    • metadata.updated datetime optional: Last time your feed was updated. Defaults to the moment you generate it.

Files must have path metadata (perhaps from metalsmith-permalinks) in order to have its links outputted in the generated XML file.


Fork this repo, install the dependecies, run the tests, submit a pull request.

$ cd metalsmith-feed-atom
$ npm install
$ grunt test

No grunt? No problem

You can run any grunt task just with npm scripts: npm run grunt -- <taskname>. Same as grunt test:

$ npm run grunt -- test

Automated workflow

You can keep the tests running automaticaly every time you make any change to the code with dev workflow:

$ grunt dev
$ npm run grunt -- dev

Always implement tests for whatever you're adding to the project. Thanks!


MIT © Almir Filho

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free