alex-shpak / hugo-book

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

Is there a way to have the homepage (/landing page) in left menu (/book ToC) with subsections? #603

Closed smillas-snow closed 4 months ago

smillas-snow commented 4 months ago

Hi, Is it possible to have the homepage (/landing page) appear in the left menu (/book ToC) with subsections?

For the explicit example in the picture: Ideally, I would like to define the main/home/landing page to be in the folder structure: '../content/handbook/_index.md' instead of '../content/_index.md', for it to be in the left hand menu (/book ToC) with subsection, like other main sections.

Is there a way to define that, or to redirect the main page? The aim is to not having to remember to copy-paste '../content/_index.md' to '../content/handbook/_index.md' when somebody makes a change.

Thanks for the help.

Handbook_homepage_file_location

alex-shpak commented 4 months ago

well, it is could be possible with some compromise, As far as I remember you can change .Site.Home./content/_index.md page in hugo, but you can make content/handbook/_index.md page to point to home page in the menu

---
bookHref: {your home url here}
---

tho, there is a catch, right now bookHref param always opens a new tab I will need to think about for solutions

smillas-snow commented 4 months ago

Hi, That's the hint I needed :), thank you so much. after playing around a bit, I ended up putting 'bookHref' in my home page: content/_index.md: '--- bookHref: /handbook/ '--- That simple redirect to the handbook index.md upon entering. It does not open any additional tabs and the menu incl. substructure is how I want it.