README
metalsmith-feed-js
To each there own and thank you for hurrymaplelad for the original metalsmith-feed.
Why the fork? CoffeeScript Sucks (tm)
This is essentially a fork of https://github.com/hurrymaplelad/metalsmith-feed with a few minor improvements to support tags as well as collections.
A metalsmith plugin to generate an RSS feed for a collection.
Requires metalsmith-collections OR metalsmith-tags
Plays nicely with permalinks, more, and excerpts.
Usage
Collections
var metalsmith = require('metalsmith')
var collections = require('metalsmith-collections')
var feed = require('metalsmith-feed-js')
metalsmith('example')
.metadata({
site: {
title: 'Example',
url: 'http://example.com',
author: 'Philodemus'
}
})
.use(collections({
posts: '*.html'
}))
.use(feed({
collection: 'posts'
}))
Tags
var metalsmith = require('metalsmith')
var tags = require('metalsmith-tags')
var feed = require('metalsmith-feed-js')
metalsmith('example')
.metadata({
site: {
title: 'Example',
url: 'http://example.com',
author: 'Philodemus'
}
})
.use(tags({
/* tag options */
}))
.use(feed({
tag: 'research'
}))
Options
collectionstring Required. Not required if tag is used The name of the configured metalsmith-collection to feed.tagstring Required. Not required if collection is used. The name of the configured metalsmith-tags to feedlimitNumber Optional. Maximum number of documents to show in the feed. Defaults to20. Set tofalseto include all documents.destinationstring Optional. File path to write the rendered XML feed. Defaults to'rss.xml'.
Remaining options are passed to the rss module as feedOptions, along with metadata.site.
If files have path metadata (perhaps from permalinks) but not url metadata, we'll prefix path with site_url to generate links. Feed item descriptions default to file.less from metalsmith-more, file.excerpt from metalsmith-excerpt, and finally the full file.contents.