Requires metalsmith-collections plugin to work.
const metalsmith = ;const collections = ;const atomfeed = ;// make sure it comes after collections
collectionstring required: Name of the configured metalsmith-collection to build the feed from.
limitnumber optional: Maximum number of files to show in the feed. Defaults to 10.
destinationstring optional: File path to write the rendered XML feed. Defaults to 'index.xml'.
metadataobject 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 test
No grunt? No problem
You can run any grunt task just with npm scripts:
npm run grunt -- <taskname>.
$ npm run grunt -- test
You can keep the tests running automaticaly every time you make any change to
the code with
$ grunt dev$ npm run grunt -- dev
Always implement tests for whatever you're adding to the project. Thanks!
MIT © Almir Filho