notes/sources/site/includes/layouts/notes.njk
Benjamin A. Shelton 4e86673a9a
Fixed current pagination classes.
Logic needs to be removed from the neighboring anchor, but I haven't
decided how exactly I would rather do this.
2025-12-15 10:32:46 -07:00

107 lines
3.1 KiB
Text

---
layout: base
pagination:
data: collections.notes
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">
<h1 class="page-title">{{ title }}</h1>
{% if content %}
<div class="sub-heading">{{ content | safe }}</div>
{% endif %}
</header>
</article>#}
<div class="bg-white pt-1100 pb-1100">
<div class="posts inner box-grid">
{% for post in notes %}
<article class="card">
{# post image #}
{% if post.data.post_image %}
<a class="box-block" href="{{ post.url | url }}">
<span class="card-header box-block">
<span class="card-categories">
{% for item in post.data.tags %}
{%- if item !== 'notes' -%}
<span class="category box-block bg-secondary color-primary text-300">{{ item | capitalize }}</span>
{%- endif -%}
{% endfor %}
</span>
<img class="card-image" data-src="{{ post.data.post_image | url }}" alt="{{ post.data.image_alt }}">
</span>
</a>
{% endif %}
<div class="card-content pt-700 pb-900 pl-300 pr-300">
<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-600" datetime="{{ post.date | timestamp }}">
{{ post.date | dateDisplay }}
</time>
</div>
</article>
{% endfor %}
</div>
</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 class="current">{{ 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>