✨ feat: add previous/next article navigation (#246)
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
"show_reading_time",
|
||||
"show_remote_changes",
|
||||
"toc",
|
||||
"show_previous_next_article_links",
|
||||
] %}
|
||||
|
||||
<table>
|
||||
@@ -129,6 +130,23 @@
|
||||
{{ throw(message="ERROR: Multiple comment systems have been enabled for the same page. Check your config.toml and individual page settings to ensure only one comment system is activated at a time.") }}
|
||||
{% endif %}
|
||||
|
||||
{% if macros_settings::evaluate_setting_priority(setting="show_previous_next_article_links", page=page, default_global_value=true) == "true" %}
|
||||
{%- if page.lower or page.higher -%}
|
||||
<nav class="full-width article-navigation">
|
||||
<div>
|
||||
{%- if page.lower -%}
|
||||
<a href="{{ page.lower.permalink | safe }}">‹ {{ page.lower.title | truncate(length=100) }}</a>
|
||||
{%- endif -%}
|
||||
</div>
|
||||
<div>
|
||||
{%- if page.higher -%}
|
||||
<a href="{{ page.higher.permalink | safe }}"> {{ page.higher.title | truncate(length=100) }} ›</a>
|
||||
{%- endif -%}
|
||||
</div>
|
||||
</nav>
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
|
||||
{% if comment_system %}
|
||||
{% include "partials/comments.html" %}
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user