You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.8 KiB
HTML
56 lines
1.8 KiB
HTML
{% macro list_posts(posts, max) %}
|
|
|
|
<div class="bloglist-container">
|
|
{% for post in posts %}
|
|
{% if loop.index <= max %}
|
|
{% if loop.index == max %}
|
|
<section class="bloglist-row">
|
|
{% elif loop.last %}
|
|
<section class="bloglist-row">
|
|
{% else %}
|
|
<section class="bloglist-row bottom-divider">
|
|
{% endif %}
|
|
|
|
{% if post.date %}
|
|
<div class="date">
|
|
{{ post.date | date(format=config.extra.date_format | default (value="%d %B %Y")) }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="bloglist-content">
|
|
<div class="bloglist-title">
|
|
<a href="{{ post.permalink }}">{{ post.title }}</a>
|
|
</div>
|
|
|
|
{% if post.taxonomies.tags %}
|
|
<div class="bloglist-tags">
|
|
{% for tag in post.taxonomies.tags %}
|
|
<a class="tag" href="{{ get_taxonomy_url(kind="tags", name=tag) }}">{{ tag }}</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="description">
|
|
{% if post.description %}
|
|
{{ post.description }}
|
|
{% elif post.summary %}
|
|
{{ post.summary | safe }}…
|
|
{% endif %}
|
|
</div>
|
|
|
|
<a class="readmore" href={{ post.permalink }}>Read more →</a>
|
|
</div>
|
|
</section>
|
|
{% endif %}
|
|
{% if not loop.last %}
|
|
{% if loop.index == max %}
|
|
<div class="all-posts">
|
|
<a href="{{ get_url(path="/blog/") }}">All posts ⟶</a>
|
|
</div>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{% endmacro %}
|