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

33 lines
1.2 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">
<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>
{{ page.body | striptags | truncate(200) }}
</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">
{{ posts.prev_link("&xlarr; Newer posts" | translate) }}
{{ posts.next_link("Older posts &xrarr;" | translate) }}
</nav>
{% endif %}
{% endblock %}