Merge pull request #24 from pawroman/fix-navigation-for-zola-0.16

Fix post navigation for Zola 0.16
This commit is contained in:
Paweł Romanowski 2022-11-10 11:54:39 +01:00 committed by GitHub
commit c06e9232db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View file

@ -8,7 +8,7 @@
See the live demo (of the default configuration) here:
https://pawroman.github.io/zola-theme-terminimal/
Tested with Zola v0.15.3.
Tested with Zola v0.16.1. Please note that earlier versions might not work because of breaking changes across Zola versions.
#### Fork disclaimer

View file

@ -58,7 +58,7 @@ menu_items = [
{name = "github", url = "https://github.com/pawroman/zola-theme-terminimal", newtab = true},
]
# Whether to show links to earlier and later posts
# Whether to show links to earlier and later (aka. higher/lower) posts
# on each post page (defaults to true).
enable_post_view_navigation = true

View file

@ -28,25 +28,25 @@
{% macro earlier_later(page) %}
{%- if config.extra.enable_post_view_navigation and page.earlier or page.later %}
{%- if config.extra.enable_post_view_navigation and page.lower or page.higher %}
<div class="pagination">
<div class="pagination__title">
<span class="pagination__title-h">{{ config.extra.post_view_navigation_prompt }}</span>
<hr />
</div>
<div class="pagination__buttons">
{%- if page.later %}
{%- if page.higher %}
<span class="button previous">
<a href="{{ page.later.permalink | safe }}">
<a href="{{ page.higher.permalink | safe }}">
<span class="button__icon"></span>&nbsp;
<span class="button__text">{{ page.later.title }}</span>
<span class="button__text">{{ page.higher.title }}</span>
</a>
</span>
{% endif %}
{% if page.earlier %}
{% if page.lower %}
<span class="button next">
<a href="{{ page.earlier.permalink | safe }}">
<span class="button__text">{{ page.earlier.title }}</span>&nbsp;
<a href="{{ page.lower.permalink | safe }}">
<span class="button__text">{{ page.lower.title }}</span>&nbsp;
<span class="button__icon"></span>
</a>
</span>