thegeeklab / hugo-geekdoc

Hugo theme made for documentation

Home Page:https://geekdocs.de

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide a way to show "Next" and "Previous" links on a page

Miepee opened this issue · comments

Something akin to this (very quickly hacked together)
grafik

I.e. using the example page, what i'd like to see:

  • Level 1
    • Level 1.1
    • Level 1.2
  • Level 2
    • Level 2.1
    • Level 2.2

If one is on Level 2 then Previous would go to Level 1.2, while Next would go to Level 2.1. If one is on Level 1.1, then Previous goes to Level 1 and Next goes to Level 1.2.
What should happen on Level 1, I'm not quite sure. Maybe Previous shouldn't show up at all. Or maybe it should also just link to the root (in this case Collapse).

Would be neat to have it possible to dis/enable it on a global level, as well as per page.

Read the docs has a nicer implementation of it if anyone would like to have another reference (scroll down all the way to the bottom):
https://docs.readthedocs.io/en/stable/tutorial/index.html

This works already using the bundle menu https://geekdocs.de/usage/menus/#bundle-menu.

You can see it in action in this example https://ansible-later.geekdocs.de/setup/pip/

Hmm, would it be out of scope to also provide that for the file tree menus?
Not a blocker for me, just asking out of curiosity.

EDIT: I also can't find geekdocNextPrev mentioned in the documentation for the page configuration. Not sure right whether this feature doesn't exist, or whether it was forgotten to add there.

Hmm, would it be out of scope to also provide that for the file tree menus?

Need to check again, IIRC there was a reason why we have not added it to the file tree menu.

Not sure right whether this feature doesn't exist, or whether it was forgotten to add there.

Just missing in the docs.

Checked the docs, It's already there, see https://geekdocs.de/usage/configuration/#site-configuration, but it's a site config not page.

I would like to keep it a global site config, IMO it doesn't make sense to disable it per page.

@Miepee Would you be able to give it a try from the main branch of the repo after the PR got merged?

Would still be interested in your feedback, just add it to this issue.

Sorry for answering that late.
Wanted to test it just now, but I seem to have problems packing the theme from source:

npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: geekdoc@1.0.0
npm ERR! notsup Not compatible with your version of node/npm: geekdoc@1.0.0
npm ERR! notsup Required: {"node":">=16.15 <=18"}
npm ERR! notsup Actual:   {"npm":"10.2.0","node":"v20.8.0"}

I am on Arch Linux, and currently can't find a way to downgrade node.

No worries, I can just tag a release later.

Sorry for the late response, just saw the release. Seems to work as expected on file trees :)