Add article list.
This commit is contained in:
parent
825caac4fa
commit
84934c65e2
29
templates/last_articles.html
Normal file
29
templates/last_articles.html
Normal 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 %}
|
@ -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 %}
|
||||||
|
Loading…
Reference in New Issue
Block a user