Vulcan/server/rss.js

19 lines
546 B
JavaScript
Raw Normal View History

// serve up RSS at the right url
Meteor.serve('feed.xml', function() {
var feed = new RSS({
2013-02-28 09:40:42 +09:00
title: getSetting('title'),
description: getSetting('tagline')
});
2013-02-28 09:40:42 +09:00
Posts.find({status: STATUS_APPROVED}, {sort: {submitted: -1}}).forEach(function(post) {
feed.item({
2013-02-28 09:40:42 +09:00
title: post.headline,
description: post.body+'</br></br> <a href="'+getPostUrl(post._id)+'">Comments</a>',
author: post.author,
2013-02-28 09:40:42 +09:00
date: post.submitted,
url: (post.url ? post.url : getPostUrl(post._id))
});
});
return feed.xml();
});