From 10dc5ef0b7d901d5718a35914ceae353ae87a903 Mon Sep 17 00:00:00 2001
From: Dane Knecht
Date: Mon, 29 Apr 2013 20:57:05 -0700
Subject: [PATCH] sort author and category pages same way as tags
---
pelican/generators.py | 2 +
.../output/basic/author/alexis-metaireau.html | 78 ++++++------
.../custom/author/alexis-metaireau.html | 110 ++++++++---------
.../custom/author/alexis-metaireau2.html | 112 +++++++++---------
4 files changed, 157 insertions(+), 145 deletions(-)
diff --git a/pelican/generators.py b/pelican/generators.py
index 13909743..dea22e17 100644
--- a/pelican/generators.py
+++ b/pelican/generators.py
@@ -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,
diff --git a/pelican/tests/output/basic/author/alexis-metaireau.html b/pelican/tests/output/basic/author/alexis-metaireau.html
index 04a89930..fc253c2c 100644
--- a/pelican/tests/output/basic/author/alexis-metaireau.html
+++ b/pelican/tests/output/basic/author/alexis-metaireau.html
@@ -26,37 +26,7 @@
-
- Other articles
-
-
-
- -
-
-
-
+
Multi-line metadata should be supported
-as well as inline markup.
+
Some content here !
+
+
This is a simple title
+
And here comes the cool stuff.
+

+

+
+>>> from ipdb import set_trace
+>>> set_trace()
+
+
→ And now try with some utf8 hell: ééé
+
+
+
+
+ Other articles
+
+
- read more
+ -
+
+
+
+
+
Why not ?
+
After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
+YEAH !
+

+
+
+
read more
diff --git a/pelican/tests/output/custom/author/alexis-metaireau.html b/pelican/tests/output/custom/author/alexis-metaireau.html
index e732fdcc..ded2e38d 100644
--- a/pelican/tests/output/custom/author/alexis-metaireau.html
+++ b/pelican/tests/output/custom/author/alexis-metaireau.html
@@ -30,7 +30,57 @@
+
+ Other articles
+
+
+
+ -
+
+
+
+
This is some article, in english
+
+
read more
+
There are comments.
+
+
+ -
+
+
+
You're mutually oblivious.
+
You're mutually oblivious.
a root-relative link to unbelievable
-a file-relative link to unbelievable
There are comments.
-
-
+
-
-
- -
-
-
-
-
Article 2
-
-
read more
-
There are comments.
-
-
- -
-
-
-
-
Article 3
-
-
read more
-
There are comments.
-
Page 1 / 3
diff --git a/pelican/tests/output/custom/author/alexis-metaireau2.html b/pelican/tests/output/custom/author/alexis-metaireau2.html
index d984d5e7..ceb6877c 100644
--- a/pelican/tests/output/custom/author/alexis-metaireau2.html
+++ b/pelican/tests/output/custom/author/alexis-metaireau2.html
@@ -32,25 +32,72 @@
-
Some cool stuff!
+
Article 2
-
read more
-
There are comments.
+ read more
+There are comments.
+
+
+ -
+
+
+
+
Article 3
+
+
read more
+
There are comments.
+
+
+ -
+
+
+
+
Multi-line metadata should be supported
+as well as inline markup.
+
+
read more
+
There are comments.
-
@@ -82,55 +129,6 @@ YEAH !
read more
There are comments.
-
-
-
-
-
-
This is some article, in english
-
-
read more
-
There are comments.
-
-
-
-
-
-
-
Multi-line metadata should be supported
-as well as inline markup.
-
-
read more
-
There are comments.
-
«