Sort articles on tag pages by publication date.

master
Ethan Dalool 2020-03-23 13:00:41 -07:00
parent 30672d0405
commit 66e6301c32
1 changed files with 3 additions and 2 deletions

View File

@ -272,11 +272,11 @@ def maketagpage(index, path):
{% endif %} {% endif %}
</section> </section>
{% if index.articles %} {% if articles %}
<section style="grid-area:articles"> <section style="grid-area:articles">
<h1>{{path}}</h1> <h1>{{path}}</h1>
<ul> <ul>
{% for article in index.articles %} {% for article in articles %}
<li> <li>
<a href="/writing/{{article.web_path}}">{{article.title}}</a> <a href="/writing/{{article.web_path}}">{{article.title}}</a>
</li> </li>
@ -306,6 +306,7 @@ def maketagpage(index, path):
''').render( ''').render(
parent=parent, parent=parent,
index=index, index=index,
articles=sorted(index.articles, key=lambda a: a.date, reverse=True),
path=path, path=path,
children=sorted(tag.name for tag in index.children.keys()), children=sorted(tag.name for tag in index.children.keys()),
) )