Paginate and add feed to bible_journal.

This commit is contained in:
Lyle Mantooth 2024-07-25 11:35:20 -04:00
parent aa4beed778
commit f8044db337
Signed by: IslandUsurper
GPG key ID: 6DB52EAE123A5789
4 changed files with 31 additions and 5 deletions

View file

@ -17,7 +17,7 @@ build_search_index = false
generate_feed = true
feed_limit = 20
feed_limit = 250
[markdown]
highlight_code = true

View file

@ -1,6 +1,8 @@
+++
title = "Bible Journal"
sort_by = "date"
paginate_by = 250
generate_feed = true
+++
As a method of accountability, a way to spark conversation, and hopefully a

View file

@ -26,9 +26,11 @@
<title>{{config.title}}</title>
{% endif %}
{% block feed %}
{% if config.generate_feed %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path=config.feed_filename, trailing_slash=false) }}">
<link rel="alternate" type="application/atom+xml" title="Atom Feed" href="{{ get_url(path=config.feed_filename, trailing_slash=false) }}">
{% endif %}
{% endblock feed %}
<body id="page">

View file

@ -1,5 +1,13 @@
{% extends "index.html" %} {% import "macros.html" as macros %} {% block header
%}
{% extends "index.html" %} {% import "macros.html" as macros %}
{% block feed %}
{% if config.generate_feed %}
{% set feed_path = section.path ~ config.feed_filename %}
<link rel="alternate" type="application/atom+xml" title="Atom Feed" href="{{ get_url(path=feed_path, trailing_slash=false) }}">
{% endif %}
{% endblock feed %}
{% block header %}
<header id="site-header" class="animated slideInUp faster">
<div class="hdr-wrapper section-inner">
<div class="hdr-left">
@ -51,7 +59,7 @@
<main class="site-main section-inner thin animated fadeIn faster">
<h1>{{ section.title }}</h1>
{{ section.content | safe }}
{% for year, pages in section.pages | group_by(attribute="year") %}
{% for year, pages in paginator.pages | group_by(attribute="year") %}
<div class="posts-group">
<div class="post-year">{{ year }}</div>
<ul class="posts-list">
@ -66,6 +74,20 @@
</ul>
</div>
{% endfor %}
<nav class="pagination">
{% if paginator.first %}
<a class="first" href="{{ paginator.first }}">&laquo;First</a>
{% endif %}
{% if paginator.previous %}
<a class="previous" href="{{ paginator.previous }}">&lsaquo;Previous</a>
{% endif %}
{% if paginator.next %}
<a class="next" href="{{ paginator.next }}">Next&rsaquo;</a>
{% endif %}
{% if paginator.last %}
<a class="last" href="{{ paginator.last }}">Last&raquo;</a>
{% endif %}
</nav>
</main>
{% endblock main %} {% block footer %} {{ macros::footer() }} {% endblock footer