Skip to content

Commit ca80c3e

Browse files
committed
Attempt fixing navigation on item detail page #18
1 parent e2c8cb9 commit ca80c3e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

templates/item.html.twig

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{% extends 'partials/base.html.twig' %}
22
{% set blog = page.find(header_var('blog_url')|defined(theme_var('blog-page'))) %}
3+
{% set pageCollection = page.parent.children() %}
34

45
{% block body %}
56
<section class="container post">
@@ -36,11 +37,15 @@
3637
{% if theme_config.post.navigation %}
3738
<footer class="page-footer">
3839
<div>
39-
{% if not page.isLast %}
40-
<div class="float-left"><i class="far fa-hand-point-left"></i> <a href="{{ page.prevSibling.url }}">Previous Article</a></div>
40+
{% if not pageCollection.isLast(page.path) %}
41+
<div class="float-left">
42+
<i class="far fa-hand-point-left"></i> <a href="{{ pageCollection.prevSibling(page.path).url }}">Previous Article</a>
43+
</div>
4144
{% endif %}
42-
{% if not page.isFirst %}
43-
<div class="float-right"><a href="{{ page.nextSibling.url }}">Next Article</a> <i class="far fa-hand-point-right"></i></div>
45+
{% if not pageCollection.isFirst(page.path) %}
46+
<div class="float-right">
47+
<a href="{{ pageCollection.nextSibling(page.path).url }}">Next Article</a> <i class="far fa-hand-point-right"></i>
48+
</div>
4449
{% endif %}
4550
</div>
4651
</footer>

0 commit comments

Comments
 (0)