Add article list.

This commit is contained in:
Fabrice Mouhartem 2019-04-23 14:14:50 +05:30
parent 825caac4fa
commit 84934c65e2
2 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,29 @@
<h1 class="section-heading" style="font-variant: small-caps">Recent Articles</h1>
{% for article in articles %}
{% if loop.index > 5 %}{% break %}{% endif %}
<div class="post-preview">
<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">
<h2 class="post-title">
{{ article.title }}
</h2>
</a>
{% if SHOW_FULL_ARTICLE %}
{{ article.content }}
{% else %}
<p class="article-summary">
{% if article.has_summary %}
{{ article.summary }}
{% elif article.summary %}
{{ article.summary|striptags|truncate(140) }}
{% endif %}
</p>
{% endif %}
<p class="post-meta">Posted by
{% for author in article.authors %}
<a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a>
{% endfor %}
on {{ article.locale_date }}
</p>
{% include 'comments.html' %}
</div>
{% endfor %}

View File

@ -28,5 +28,9 @@
{% block content %} {% block content %}
<article> <article>
{{ page.content }} {{ page.content }}
{% if page.article_list %}
<hr />
{% include "last_articles.html" %}
{% endif %}
</article> </article>
{% endblock content %} {% endblock content %}