Updated site layout for preliminary pagination handling.

This commit is contained in:
Benjamin A. Shelton 2025-11-25 14:40:02 -07:00
commit 1d7d85e20f
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01
2 changed files with 32 additions and 7 deletions

View file

@ -2,12 +2,14 @@
layout: base
pagination:
data: collections.notes
size: 3
size: 6
alias: notes
permalink: notes/{{ notes | slugify }}/index.html
---
<main id="main" class="main box-flex" tabindex="-1">
{#
<article id="container-centre" class="column centre">
<header class="page-header inner pt-700 pb-600">
@ -22,7 +24,7 @@ pagination:
</header>
</article>
</article>#}
<div class="bg-white pt-1100 pb-1100">
@ -43,7 +45,7 @@ pagination:
{% for item in post.data.tags %}
{%- if item !== 'blog' -%}
{%- if item !== 'notes' -%}
<span class="category box-block bg-secondary color-primary text-300">{{ item | capitalize }}</span>
@ -63,9 +65,12 @@ pagination:
<div class="card-content pt-700 pb-900 pl-300 pr-300">
<h2><a class="card-title-link color-primary weight-regular hover-color-secondary" href="{{ post.url | url }}">{{ post.data.title }}</a></h2>
<h3><a class="card-title-link color-primary weight-regular hover-color-secondary" href="{{ post.url | url }}">{{ post.data.title }}</a></h3>
{%- if post.data.sub_heading -%}
<h4>{{ post.data.sub_heading }}</h4>
{%- endif -%}
<time class="datetime color-grey text-400" datetime="{{ post.date | timestamp }}">
<time class="datetime color-grey text-600" datetime="{{ post.date | timestamp }}">
{{ post.date | dateDisplay }}
</time>
@ -79,4 +84,24 @@ pagination:
</div>
{% if pagination.pages.length > 1 %}
<div class="pagination inner box-grid">
<ul>
{%- if pagination.href.previous %}
<li><a href="{{ pagination.href.previous }}">&laquo; Prev</a></li>
{% endif -%}
{% for entry in pagination.pages %}
{% if page.url == pagination.hrefs[loop.index0] %}
<li>{{ loop.index }}</li>
{% else %}
<li><a href="/sundays{{ pagination.hrefs[ loop.index0 ] }}"{% if page.url == pagination.hrefs[ loop.index0 ] %} class="current"{% endif %}>{{ loop.index }}</a></li>
{% endif %}
{% endfor %}
{%- if pagination.href.next %}
<li><a href="{{ pagination.href.next }}">Next &raquo;</a></li>
{% endif -%}
</ul>
</div>
{% endif %}
</main>