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.
Install it via NPM:
$ npm install metalsmith-feed-atomconst metalsmith = require('metalsmith');
const collections = require('metalsmith-collections');
const atomfeed = require('metalsmith-feed-atom');
metalsmith('working/dir')
.use(collections({articles: '*.html'}))
.use(atomfeed({collection: 'articles'})) // make sure it comes after collectionsType: String (Required)
Name of the configured metalsmith-collection to build the feed from.
Type: Number (Optional)
Maximum number of files to show in the feed. Defaults to 10.
Type: String (Optional)
File path to write the rendered XML feed. Defaults to 'index.xml'.
Type: 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.titlestring required: Title of your site/feed.metadata.subtitlestring optional: Subtitle of your site/feed.metadata.urlstring required: Url of your site. This is also used as base url to produce files (feed entries) urls.metadata.updateddatetime 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 testYou can run any grunt task just with npm scripts: npm run grunt -- <taskname>.
Same as grunt test:
$ npm run grunt -- testYou can keep the tests running automaticaly every time you make any change to
the code with dev workflow:
$ grunt dev
$ npm run grunt -- devAlways implement tests for whatever you're adding to the project. Thanks!
MIT © Almir Filho