aboutsummaryrefslogtreecommitdiff
path: root/templates/macros
diff options
context:
space:
mode:
authorJoris2025-01-26 17:58:57 +0100
committerJoris2025-01-26 17:58:57 +0100
commit24eeb54a6b7159964e8887ade7fa5173b50feb3a (patch)
tree91af6253df784445db9b084b02b38b37a83224e8 /templates/macros
parentc5759f348e70cf54b4bfa4cd17e1fe1828ead30a (diff)
Replace tera by minijinjamain
tera was doing the job all right, but minijinja has fewer dependencies.
Diffstat (limited to 'templates/macros')
-rw-r--r--templates/macros/paging.html16
1 files changed, 5 insertions, 11 deletions
diff --git a/templates/macros/paging.html b/templates/macros/paging.html
index 59ba617..840e8f4 100644
--- a/templates/macros/paging.html
+++ b/templates/macros/paging.html
@@ -1,10 +1,4 @@
-{% macro paging(url, page, max_page) %}
- {% if url is containing("?") %}
- {% set sign = "&" %}
- {% else %}
- {% set sign = "?" %}
- {% endif %}
-
+{% macro view(url, page, max_page) %}
<div class="g-Paging">
{% if page > 1 %}
<a
@@ -15,7 +9,7 @@
</a>
<a
class="g-Paging__Link g-Paging__Link--Active"
- href="{{ url }}{{ sign }}page={{ page - 1 }}"
+ href="{{ url | with_param("page", page - 1) }}"
>
</a>
@@ -33,13 +27,13 @@
{% if page < max_page %}
<a
class="g-Paging__Link g-Paging__Link--Active"
- href="{{ url }}{{ sign }}page={{ page + 1 }}"
+ href="{{ url | with_param("page", page + 1) }}"
>
</a>
<a
class="g-Paging__Link g-Paging__Link--Active"
- href="{{ url }}{{ sign }}page={{ max_page }}"
+ href="{{ url | with_param("page", max_page) }}"
>
❭❭
</a>
@@ -52,4 +46,4 @@
</span>
{% endif %}
</div>
-{% endmacro paging %}
+{% endmacro %}