Display recent articles on the homepage

This commit is contained in:
Bat
2018-05-12 13:56:38 +01:00
parent a74215ef07
commit 397d25e431
3 changed files with 31 additions and 3 deletions
+10 -1
View File
@@ -5,5 +5,14 @@
{% endblock title %}
{% block content %}
<h1>Welcome on {{ instance.name }}</h1>
<h1>Welcome on {{ instance.name }}</h1>
<h2>Latest articles</h2>
{% for article in recents %}
<div>
<h3><a href="{{ article.url }}">{{ article.post.title }}</a></h3>
<p>{{ article.post.content | escape | truncate(length=200) }}…</p>
<p>By {{ article.author.display_name }} ⋅ {{ article.date | date(format="%B %e") }}</p>
</div>
{% endfor %}
{% endblock content %}