malta icon indicating copy to clipboard operation
malta copied to clipboard

feat(src): add page navigation to main section

Open lordelogos opened this issue 2 years ago • 3 comments

PR Description

This PR affects

  • src and docs

This PR contains the following:

  • Addition of "Previous" and "Next" buttons for easy navigation between pages (especially on mobile)
  • Docs update on the need to build before running preview

I am open to any changes needed to push this PR through.

Some screenshots of the update

Section with previous and next

Screenshot 2024-03-11 at 17 57 31

Section with just previous and doc changes

Screenshot 2024-03-11 at 17 58 20

lordelogos avatar Mar 11 '24 16:03 lordelogos

So one issue with this approach (using the sidebar) is that you can nest pages. For example, https://lucia-auth.com/guides/oauth. It wouldn't make sense if the next page of "OAuth basics" is "Email and password."

pilcrowonpaper avatar Mar 12 '24 03:03 pilcrowonpaper

Personally, I'm fine with not having next/previous buttons. It doesn't bother me too much, especially if each page is pretty long

pilcrowonpaper avatar Mar 12 '24 03:03 pilcrowonpaper

The example you stated here perfectly brings up something I also thought about.

Having the Section title at the top of each page in a smaller, more subtle text.

e.g Small text: "Guides" Main text: "Oauth"

The main aim of those buttons is a quicker navigation between the pages of a section.

Personally, I think having to go to the nav bar to go to the next section is a poor UX (especially on mobile, I experienced this firsthand when I was first reading the Copenhagen book which was the inspiration behind this PR)

I think you should give it a try, it flows much better navigating at the bottom of the main section than having to go to the nav bar (either at the left or at the top on mobile) to change pages in each section. Plus if you want to do that, you still can even with these buttons.

Edit: #5fe54d6 adds the section title to the markup

Screenshot 2024-03-13 at 04 12 44

lordelogos avatar Mar 12 '24 05:03 lordelogos