2013-02-27 17:45:43 +09:00
|
|
|
// 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-27 17:45:43 +09:00
|
|
|
});
|
|
|
|
|
2013-02-28 09:40:42 +09:00
|
|
|
Posts.find({status: STATUS_APPROVED}, {sort: {submitted: -1}}).forEach(function(post) {
|
2013-02-27 17:45:43 +09:00
|
|
|
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>',
|
2013-02-27 17:45:43 +09:00
|
|
|
author: post.author,
|
2013-02-28 09:40:42 +09:00
|
|
|
date: post.submitted,
|
|
|
|
url: (post.url ? post.url : getPostUrl(post._id))
|
2013-02-27 17:45:43 +09:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
return feed.xml();
|
|
|
|
});
|