From 84934c65e2b00356474c9dfe4fd801403fed6499 Mon Sep 17 00:00:00 2001 From: Fabrice Mouhartem Date: Tue, 23 Apr 2019 14:14:50 +0530 Subject: [PATCH] Add article list. --- templates/last_articles.html | 29 +++++++++++++++++++++++++++++ templates/page.html | 4 ++++ 2 files changed, 33 insertions(+) create mode 100644 templates/last_articles.html diff --git a/templates/last_articles.html b/templates/last_articles.html new file mode 100644 index 0000000..bf00a91 --- /dev/null +++ b/templates/last_articles.html @@ -0,0 +1,29 @@ +

Recent Articles

+{% for article in articles %} + {% if loop.index > 5 %}{% break %}{% endif %} +
+ +

+ {{ article.title }} +

+
+ {% if SHOW_FULL_ARTICLE %} + {{ article.content }} + {% else %} +

+ {% if article.has_summary %} + {{ article.summary }} + {% elif article.summary %} + {{ article.summary|striptags|truncate(140) }} + {% endif %} +

+ {% endif %} + + {% include 'comments.html' %} +
+{% endfor %} diff --git a/templates/page.html b/templates/page.html index 0d93477..ff7fe09 100644 --- a/templates/page.html +++ b/templates/page.html @@ -28,5 +28,9 @@ {% block content %}
{{ page.content }} + {% if page.article_list %} +
+ {% include "last_articles.html" %} + {% endif %}
{% endblock content %}