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

54 lines
1.8 KiB
Twig
Raw Normal View History

2024-06-20 14:10:42 +00:00
{% extends "layouts" ~ DIR ~ "default.twig" %}
{% block content %}
{% if posts.paginated is not empty or pages is not empty %}
<div class="filter">{{ "Search results for &#8220;%s&#8221;" | translate | format(search | fix) }}</div>
{% else %}
<div role="status">{{ "Your search did not return any results." | translate }}</div>
{% endif %}
{% if pages is not empty %}
<details{% if posts.paginated is empty %} open{% endif %}>
<summary>{{ "Pages containing the search term" | translate }}</summary>
{% for page in pages %}
<article class="fragment">
2024-09-05 17:51:48 +00:00
<header>
<span class="permalink">
<a href="{{ page.url() }}" rel="bookmark" title="{{ 'Permanent link to &#8220;%s&#8221;' | translate | format(page.title | striptags | normalize | fix(true)) }}">&dagger;</a>
</span>
<span class="time">
{% if page.updated %}
{{ "Updated on %s." | translate | format(page.updated_at | time) }}
{% else %}
{{ "Created on %s." | translate | format(page.created_at | time) }}
{% endif %}
</span>
</header>
2024-06-20 14:10:42 +00:00
<h2 class="page_title">
<a href="{{ page.url() }}" rel="bookmark" title="{{ 'Permanent link to &#8220;%s&#8221;' | translate | format(page.title | striptags | normalize | fix(true)) }}">{{ page.title }}</a>
</h2>
2024-09-05 17:51:48 +00:00
<section>
2024-06-20 14:10:42 +00:00
{{ page.body | striptags | truncate(200) }}
2024-09-05 17:51:48 +00:00
</section>
<footer>
{% if page.editable() or page.deletable() %}
<div class="doaction admin">
{{ page.edit_link() }} {{ page.delete_link() }}
</div>
{% endif %}
</footer>
2024-06-20 14:10:42 +00:00
</article>
{% endfor %}
</details>
{% endif %}
{% 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 %}
{% endblock %}