mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
sort author and category pages same way as tags
This commit is contained in:
parent
2a53934834
commit
10dc5ef0b7
4 changed files with 102 additions and 90 deletions
|
|
@ -335,6 +335,7 @@ class ArticlesGenerator(Generator):
|
|||
"""Generate category pages."""
|
||||
category_template = self.get_template('category')
|
||||
for cat, articles in self.categories:
|
||||
articles.sort(key=attrgetter('date'), reverse=True)
|
||||
dates = [article for article in self.dates if article in articles]
|
||||
write(cat.save_as, category_template, self.context,
|
||||
category=cat, articles=articles, dates=dates,
|
||||
|
|
@ -345,6 +346,7 @@ class ArticlesGenerator(Generator):
|
|||
"""Generate Author pages."""
|
||||
author_template = self.get_template('author')
|
||||
for aut, articles in self.authors:
|
||||
articles.sort(key=attrgetter('date'), reverse=True)
|
||||
dates = [article for article in self.dates if article in articles]
|
||||
write(aut.save_as, author_template, self.context,
|
||||
author=aut, articles=articles, dates=dates,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue