leilukin-tumbleblog/themes/virgula/pages/archive.twig

67 lines
1.8 KiB
Twig
Raw Normal View History

2024-06-20 14:10:42 +00:00
{% extends "layouts" ~ DIR ~ "default.twig" %}
{% block content %}
{# Months? (For yearly archives) #}
{% if months is not empty %}
<h2>{{ "Archive of %s" | translate | format(archive.when | time("Y")) }}</h2>
<ul>
{% for when, month in months %}
<li>
<h3>
<a href="{{ url('archive/%s/' | format(when | dateformat('Y/m'))) }}">
2024-09-05 17:51:48 +00:00
{{ when | time("F" | translate, "title") }}
2024-06-20 14:10:42 +00:00
</a>
</h3>
<ul>
{% for post in month %}
<li>
<a href="{{ post.url() }}" rel="bookmark" title="{{ 'Permanent link to &#8220;%s&#8221;' | translate | format(post.title() | striptags | fix(true)) }}">
{{ post.title() }}
</a>
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
{% if archive.prev is not empty or archive.next is not empty %}
<nav class="traversal">
{% if archive.prev is not empty %}
<a href="{{ url('archive/%s/' | format(archive.prev | dateformat('Y'))) }}">
2024-09-05 17:51:48 +00:00
{{ "Newer posts" | translate }}
2024-06-20 14:10:42 +00:00
</a>
{% endif %}
{% if archive.next is not empty %}
<a href="{{ url('archive/%s/' | format(archive.next | dateformat('Y'))) }}">
2024-09-05 17:51:48 +00:00
{{ "Older posts" | translate }}
2024-06-20 14:10:42 +00:00
</a>
{% endif %}
</nav>
{% endif %}
{% endif %}
{# Posts? (For daily/monthly archives) #}
{% if posts.paginated is not empty %}
<div class="filter">
{{ "Archive of %s" | translate | format(archive.when | time(archive.depth == "day" ? "d F Y" : "F Y")) }}
</div>
{% for post in posts.paginated %}
{% include(["feathers" ~ DIR ~ post.feather ~ ".twig", "feathers" ~ DIR ~ "missing.twig"]) %}
{% endfor %}
{% if posts.prev_page() or posts.next_page() %}
<!-- Navigation -->
<nav class="traversal">
2024-09-05 17:51:48 +00:00
{{- posts.prev_link("Newer posts" | translate) -}}
{{- posts.next_link("Older posts" | translate) -}}
2024-06-20 14:10:42 +00:00
</nav>
{% endif %}
{% endif %}
{# No results #}
{% if months is empty and posts.paginated is empty %}
<div role="status">{{ "There aren't any posts in the timeframe you specified." | translate }}</div>
{% endif %}
{% endblock %}