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'),
|
2013-02-28 10:07:54 +09:00
|
|
|
description: getSetting('tagline'),
|
|
|
|
feed_url: Meteor.absoluteUrl()+'feed.xml',
|
|
|
|
site_url: Meteor.absoluteUrl(),
|
2013-02-28 11:02:21 +09:00
|
|
|
image_url: Meteor.absoluteUrl()+'img/favicon.png',
|
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,
|
2013-02-28 11:02:21 +09:00
|
|
|
url: (post.url ? post.url : getPostUrl(post._id)),
|
|
|
|
guid: post._id
|
2013-02-27 17:45:43 +09:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
return feed.xml();
|
|
|
|
});
|