razonyang / hugo-theme-bootstrap

A fast, responsive, multipurpose and feature-rich Hugo theme.
https://hbs.razonyang.com
MIT License
508 stars 166 forks source link

Navigation links on docs pages are incorrect #1079

Closed sdwheeler closed 1 week ago

sdwheeler commented 1 week ago

Prerequisites

Describe the issue

There are two issues:

  1. The left-hand link should point to the previous item and the right-hand link should point to the next item.
  2. The prev/next links are not following the Nav order in the TOC

Steps to reproduce

In this screenshot you can see (from the TOC) that I am viewing the Docs Layout page. image

In the navigation links at the bottom of the page

Expected behavior

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Microsoft Edge

What version of theme are you using?

hugo-theme-bootstrap v1.7.3

What version of Hugo are you using?

hugo v0.134.3

What version of Node.js are you using?

v20.16.0

What version of Git are you using?

git version 2.47.0.windows.2

Additional context

Part of the problem is in partials/post/nav.html. To fix this I swapped the order of the next/prev divs.

{{- if and (default true .Site.Params.post.nav) (default true .Params.nav) (or .PrevInSection .NextInSection) -}}
<div class="card-footer">
  <div class="post-navs d-flex justify-content-evenly">
    {{- with .NextInSection -}}
    <div class="post-nav post-next">
      <i class="fas fa-fw fa-chevron-down post-next-icon ms-1" data-fa-transform="rotate-90"></i>
      <a href="{{ .RelPermalink }}">{{ partial "helpers/title" . }}</a>
    </div>
    {{- end -}}
    {{- with .PrevInSection -}}
    <div class="post-nav post-prev">
      <a href="{{ .RelPermalink }}">{{ partial "helpers/title" . }}</a>
      <i class="fas fa-fw fa-chevron-down post-prev-icon me-1" data-fa-transform="rotate-270"></i>
    </div>
    {{- end -}}
  </div>
</div>
{{- end -}}
razonyang commented 1 week ago

Thank you for your feedback.