publishing Paxover to Codeberg

This commit is contained in:
2023-01-12 20:00:00 +01:00
commit 690707f090
45 changed files with 1796 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
{% extends 'partials/base.html.twig' %}
{% if uri.param('tag') %}
{% set page_title = theme_config.blog.tag_title | default('Tag: ') ~ uri.param('tag') %}
{% else %}
{% set page_title = theme_config.blog.title | default('Blog') %}
{% endif %}
{% block content %}
{% set collection = page.collection({
'items': '@self.children',
'pagination': true,
'order': {'by': 'date', 'dir': 'desc'},
'limit': theme_config.blog.pagination_limit})
%}
{% set itemsInCollection = page.collection({'items': collection.params.items})|length %}
{% set currentPage = uri.param('page')|default('1') %}
{% set itemsPerPage = collection.params.limit %}
{% set pagesInCollection = (itemsInCollection / itemsPerPage)|round(0, 'ceil') %}
{% if page_title == 'Blog' %}
{{ page.content | raw }}
{% else %}
<h2>{{ page_title }}</h2>
{% endif %}
<div class="blog">
{% for child in collection %}
{% include 'partials/blog-list-item.html.twig' with {blog: page, page: child} %}
{% endfor %}
</div>
{% if itemsInCollection > itemsPerPage %}
<div class="pagination">
{% if currentPage != '1' %}
<span class="pagination-newer"><a href="{{ page.url(true) ~ '/page' ~ system.param_sep ~ (currentPage - 1) }}">{{ theme_config.blog.pagination_newer_en }}</a></span>
{% endif %}
{% if (currentPage + 1) <= pagesInCollection %}
<span class="pagination-older"><a href="{{ page.url(true) ~ '/page' ~ system.param_sep ~ (currentPage + 1) }}">{{ theme_config.blog.pagination_older_en}}</a></span>
{% endif %}
</div>
{% endif %}
{% endblock %}