Add proper pagination
This commit is contained in:
+18
-3
@@ -14,13 +14,28 @@
|
||||
{% if paginator.total_pages > 1 %}
|
||||
<ul class="pager">
|
||||
{% if paginator.previous_page %}
|
||||
<li class="previous">
|
||||
<a href="{{ paginator.previous_page_path | absolute_url }}">← Newer Posts</a>
|
||||
<li class="first">
|
||||
<a href="{{ paginator.first_page_path | absolute_url }}" alt="Oldest Entries">«</a>
|
||||
</li>
|
||||
<li class="prev">
|
||||
<a href="{{ paginator.previous_page_path | absolute_url }}" alt="Older Entries">←</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if paginator.page_trail %}
|
||||
{% for trail in paginator.page_trail %}
|
||||
<li class="page{% if page.url == trail.path %} selected{% endif %}">
|
||||
<a href="{{ trail.path | absolute_url }}">{{ trail.num }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if paginator.next_page %}
|
||||
<li class="next">
|
||||
<a href="{{ paginator.next_page_path | absolute_url }}">Older Posts →</a>
|
||||
<a href="{{ paginator.next_page_path | absolute_url }}" alt="Newer Entries">→</a>
|
||||
</li>
|
||||
<li class="last">
|
||||
<a href="{{ paginator.last_page_path | absolute_url }}" alt="Newest Entries">»</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
@@ -47,6 +47,15 @@ $theme-button-background: hsl($theme-hue, 100%, 30.0%);
|
||||
$theme-button-background-active: hsl($theme-hue, 100%, 50%);
|
||||
$theme-button-color: hsl($theme-hue, 0%, 100%);
|
||||
$theme-button-color-active: hsl($theme-hue, 100%, 100%);
|
||||
$theme-pagination-background: hsl($theme-hue, 50%, 10%);
|
||||
$theme-pagination-background-active: hsl($theme-hue, 100%, 50%);
|
||||
$theme-pagination-background-selected: hsl($theme-hue, 100%, 33%);
|
||||
$theme-pagination-shadow: 0px 3px 6px 1px hsla(0, 0, 0, 0.75);
|
||||
$theme-pagination-shadow-active: 0px 3px 6px 1px hsla(0, 0, 0, 0.75);
|
||||
$theme-pagination-shadow-selected: 0px 3px 6px 1px hsla(0, 0, 0, 0.75);
|
||||
$theme-pagination-color: $theme-content-color;
|
||||
$theme-pagination-color-active: hsl($theme-hue, 100%, 100%);
|
||||
$theme-pagination-color-selected: hsl($theme-hue, 100%, 50%);
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
|
||||
@@ -11,3 +11,4 @@ body > .content {
|
||||
@import "_blocks.scss";
|
||||
@import "_comments.scss";
|
||||
@import "_index.scss";
|
||||
@import "_pagination.scss";
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
.pager {
|
||||
display: block;
|
||||
width: fit-content;
|
||||
margin: 1rem auto;
|
||||
padding: 0;
|
||||
list-style: none inside;
|
||||
}
|
||||
|
||||
.pager > li {
|
||||
display: inline-block;
|
||||
margin: 0 .25rem;
|
||||
padding: 0;
|
||||
font-weight: bold;
|
||||
font-size: 1.333rem;
|
||||
line-height: 1.333rem;
|
||||
vertical-align: top;
|
||||
|
||||
background: $theme-pagination-background;
|
||||
box-shadow: $theme-pagination-shadow;
|
||||
color: $theme-pagination-color;
|
||||
}
|
||||
|
||||
.pager > li:hover,
|
||||
.pager > li:focus {
|
||||
background: $theme-pagination-background-active;
|
||||
box-shadow: $theme-pagination-shadow-active;
|
||||
color: $theme-pagination-color-active;
|
||||
}
|
||||
|
||||
.pager > .selected {
|
||||
background: $theme-pagination-background-selected;
|
||||
box-shadow: $theme-pagination-shadow-selected;
|
||||
color: $theme-pagination-color-selected;
|
||||
}
|
||||
|
||||
.pager > li > a {
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
line-height: 2.5rem;
|
||||
width: 5rem;
|
||||
height: 2.5rem;
|
||||
}
|
||||
Reference in New Issue
Block a user