Merge pull request #431 from delgermurun/exclude-scheduled-posts-from-rss

Exclude posts scheduled in the future from the RSS feed
This commit is contained in:
Sacha Greif 2014-09-26 13:38:20 +09:00
commit eeb961d905

View file

@ -13,7 +13,11 @@ var getMeta = function() {
servePostRSS = function() {
var feed = new RSS(getMeta());
Posts.find({status: STATUS_APPROVED}, {sort: {postedAt: -1}, limit: 20}).forEach(function(post) {
filters = {
status: STATUS_APPROVED,
postedAt: {$lte: new Date()}
};
Posts.find(filters, {sort: {postedAt: -1}, limit: 20}).forEach(function(post) {
var description = !!post.body ? post.body+'</br></br>' : '';
feed.item({
title: post.title,