Skip to content

Edited navigation.html #75

@piharpi

Description

@piharpi

Discussed in #72

Originally posted by muzzug February 8, 2023
Hi.

If there is anyone here who, like me, is bothered by the weird navigation behaviour for previous/next posts (on the first post "next" is on the left, on the others on the right and on the last one "previous" is on the left), I offer a modified version. Just use the code to replace the code in navigation.html

<nav class="post-nav">
  <div class="post-nav-item post-nav-prev">
    <div class="nav-arrow"> Previous </div>
    {% if page.previous %}
    <a href="{{ page.previous | relative_url }}">
      <span class="post-title">{{ page.previous.title }}</span>
    </a>
    {% endif %}
  </div>
    
  <div class="post-nav-item post-nav-next">
    <div class="nav-arrow">Next</div>
    {% if page.next %}
    <a href="{{ page.next | relative_url }}">
      <span class="post-title">{{ page.next.title }}</span>
    </a>
    {% endif %}
  </div> 
</nav>

Just beware - only the title of the previous/next article is active in this case. The "next" and "previous" itself no longer work as a link as in the original code. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions