Permalink
Browse files

Fix the articles sorting in feed.xml.

The articles in feed.xml was ordered by creation date. Now it is ordered by the article's date meta.

Signed-off-by: Thomas Seng Hin Mak <makzan@gmail.com>
  • Loading branch information...
1 parent f6801e7 commit 08d503b23c7dd1e89e23813306a4129f7e0162cf Thomas Seng Hin Mak committed Sep 14, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 examples/blog/templates/feed.jade
@@ -4,8 +4,8 @@ rss(version='2.0',
xmlns:wfw='http://wellformedweb.org/CommentAPI/',
xmlns:dc='http://purl.org/dc/elements/1.1/'
xmlns:atom='http://www.w3.org/2005/Atom')
- channel
- - var articles = contents.articles._.directories.map(function(item){ return item.index });
+ channel
+ - var articles = _.chain(contents.articles._.directories).map(function(item){ return item.index }).sortBy(function(item) { return -item.date }).value();
title= locals.name
atom:link(href=locals.url + '/feed.xml', rel='self', type='application/rss+xml')
link= locals.url

0 comments on commit 08d503b

Please sign in to comment.