mirror of
https://github.com/almet/notmyidea.git
synced 2025-04-28 19:42:37 +02:00
30 lines
No EOL
1.6 KiB
HTML
30 lines
No EOL
1.6 KiB
HTML
{% macro list_articles(articles, included_categories, excluded_categories=(), title=None, display_category=True, limit=None, see_more=None) -%}
|
|
<ul class="articles_list">
|
|
{% if title is defined %}<li><span class="metadata date"><h2>{{ title }}</h2></span></li>{% endif %}
|
|
|
|
{% for article in articles | rejectattr("category", "in", excluded_categories) | selectattr("category", "in", included_categories) | batch(limit) | first %}
|
|
{% if not article.unlisted or article.category == category %}
|
|
<li>
|
|
<span class="metadata date">{{ article.date.strftime("%B %Y") }}</span>
|
|
<a class="post_title" href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a>
|
|
{% if display_category %}<span class="metadata category">{{ article.category }}</span>{% endif %}
|
|
</li>
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% if see_more %}<li><span class="metadata date">…</span><a class="post_title" href="{{ see_more }}">plus d'articles </a> </li>{% endif %}
|
|
</ul>
|
|
{%- endmacro %}
|
|
|
|
{% macro list_tag(articles, title, limit=None) -%}
|
|
<ul class="articles_list">
|
|
{% if title is defined %}<li><span class="metadata date"><h2>{{ title }}</h2></span></li>{% endif %}
|
|
|
|
{% for article in articles | batch(limit) | first %}
|
|
<li>
|
|
<span class="metadata date">{{ article.date.strftime("%B %Y") }}</span>
|
|
<a class="post_title" href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a>
|
|
<span class="metadata category">{{ article.category }}</span>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{%- endmacro %} |