Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edited navigation.html #75

Open
piharpi opened this issue Mar 8, 2023 Discussed in #72 · 0 comments
Open

Edited navigation.html #75

piharpi opened this issue Mar 8, 2023 Discussed in #72 · 0 comments

Comments

@piharpi
Copy link
Owner

piharpi commented Mar 8, 2023

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant