alex-shpak / hugo-book

Hugo documentation theme as simple as plain book
https://hugo-book-demo.netlify.app
MIT License
3.4k stars 1.17k forks source link

Example for menu with subdirectories #634

Open LasseKrache opened 2 months ago

LasseKrache commented 2 months ago

Hello,

As I am new to hugo and hugo-book this is probably not an error or issue ... it is just a stupid question.

I am unable to get the menu with the correct entries with this content:

/computer /computer/hardware

/computer/software

/computer/software/windows

/computer/software/linux

I would like a menu with the entries "software" and "hardware" and beneath software the entry "windows" and so on.

What I get is a list of ALL md files in one row when I use BookSection = '*' I guess there is another option that needs to be set ... but which one? Can someone post an example of a configuration, which works as descibed?

Any help would be very appreciated! Lasse

alex-shpak commented 5 days ago

Hi! You can turn pages into leaf nodes, so they don't show pages under them /computer/hardware/index.md /computer/software/index.md

or you can go thought pages under them and set bookHidden: true property to hide them from the menu