Highlight current page in pagination (#207)

This commit is contained in:
Arseniy authored and GitHub committed 2024-03-28 19:42:18 -04:00
1 parent 28791ea0e7
commit a96a21289d
2 files changed
+17 -1

No files matched your search

+8
View File
@@ -9,6 +9,10 @@
justify-content: center;
}
.pages {
display: flex;
}
.page, .ellipsis {
display: inline-block;
padding: 6px 1rem;
@@ -36,6 +40,10 @@
border-bottom-left-radius: 7px;
}
.current {
background-color: var(--color3);
}
.next {
border-top-right-radius: 7px;
border-bottom-right-radius: 7px;
+9 -1
View File
@@ -5,7 +5,15 @@
<i class="fa-solid fa-arrow-left"></i>
</a>
<div class="pages">
{% for page in paging.pages %}{% if page != "..." %}<a class="page" href="/{{ paging.url }}/{{ page }}">{{ page }}</a>{% else %}<span class="page ellipsis"><i class="fa-solid fa-fw fa-1x fa-ellipsis"></i></span>{% endif %}{% endfor %}
{% for page in paging.pages %}
{% if page == "..." %}
<span class="page ellipsis"><i class="fa-solid fa-fw fa-1x fa-ellipsis"></i></span>
{% elif page == paging.page %}
<a class="page current" href="/{{ paging.url }}/{{ page }}">{{ page }}</a>
{% else %}
<a class="page" href="/{{ paging.url }}/{{ page }}">{{ page }}</a>
{% endif %}
{% endfor %}
</div>
<a class="page next" href="/{{ paging.url }}/{{ paging.next }}">
<i class="fa-solid fa-arrow-right"></i>