Noob hugo-book Theme questions: Collapsible menu items and dark mode

Hi these are a couple of simple questions regarding hugo-book theme GitHub - alex-shpak/hugo-book: Hugo documentation theme as simple as plain book).

As per the thread title. I want the site to be in dark mode. And I want collapsible menu items (which I think I create by using subfolders inside my content/docs folder,

I have been experimenting with hugo and the book theme for a few days. Previously I have had multiple pages built that populate the side menu as expected, however I didn’t have the collapsible menu items and I didn’t have dark mode. On a fresh site I did the following, and now I just get a Page Not Found error message. Any help is appreciated. I realise this is simple stuff. I have tried various tutorials I have found but haven’t found one that isn’t using obsoleted settings - if one exists that will get me to the point I want to be at, please let me know.

Thanks

hugo new site mysite
cd themes`
git clone https://github.com/alex-shpak/hugo-book.git
echo "BookTheme = ' dark'" >> hugo.toml
echo 'BookSection = "*"' >> hugo.toml
mkdir -p content/docs/C1
mkdir -p content/docs/test2
hugo new content/docs/test1/page1.md
hugo new content/docs/test1/page2.md
vim content/docs/test1/page1.md (set 'draft' to false and wrote 'This is page 1')
vim content/docs/test1/page2.md (set 'draft' to false and wrote 'This is page 2')
hugo server

And I get ‘Page Not Found’, and the page is not in dark mode.

So:

hugo new content/docs/Page3.md
vim content/docs/Page3.md (set 'draft' to false and wrote 'This is page 3'
rm -r public
hugo server

And again, Page Not Found and the page is not in dark mode.

Your chances to get a quick and accurate answer on these questions are highest if you ask the theme author.

Thanks for your reply, even if it isn’t a huge amount of help.

When searching for answers I noticed many responses on this site that were similarly unhelpful. If that is the culture here then that is a pity, I guess I should look for the theme’s author.

However I am asking some pretty straightforward stuff so perhaps somebody will reply with something helpful.

The author of the theme is the person best placed to answer. Would you rather wait here for answers instead of being told where your chances are better? How is that unhelpful?

And you’re ignoring the basic requirements set forth in the „asking for help“ thread pinned at the top of the forum. Pretty straightforward, too.

  1. You didn’t say where this author is available for what are two pretty general basic and straightforward questions relevant to many themes.

I would very much rather not continue this pointless discussion and simply wait to see if anybody more helpful comes along.

Thank you

From the docs at GitHub - alex-shpak/hugo-book: Hugo documentation theme as simple as plain book, your parameters must reside below the param key.

Also I don’t think you’ll need BookSection. And even if, I am pretty certain that your value * will not do what you may think it will do.

Your BookTheme parameter contains a superflous space.

My advise is not tested. I agree to previous posters, that you may get quicker and more in depth help from the theme maintainer.

before I get to the point. (skip to the next chapter if you don’t want to read that)

please calm down - read the next two sections and recheck which kind of errors you have

TL;TR

short explanation (very abstract and brief)

  • hugo is a static site generator - you can see it as a compiler for markdown files to html using templates and styles

  • a theme is a set of markdown and styles provided by a third party which saves you from doing all that stuff yourself.

Your Questions are definitely of the kind “How do I get the THEME working” and not "how do I customize the code to achive something the theme does not provide.

But let’s get back to your Problem:

  • your example code does not work and any supporter has to recheck every line. Just try to replay it line by line. it contains errornous commands and stuff not needed. short you may not get a working site with that.

  • the Author documents two ways to install the theme. you choose a third one simple clone which is OK if you know what you are doing.

  • the usual way to get support for a software published on github is to use the repositories issue tracker (Requesting Help: Some knowledge required)

  • the BookTheme and BookSection parameters are very special to the Hugo-Book theme far away to be a common notation or functionality (except from setting parameters :wink:

  • And I get ‘Page Not Found’, and the page is not in dark mode which implies that there is no page (where?) and if there’s no page, how yould it be in any mode.

Your Errors

  • you did not activate the theme in hugo.toml by adding theme = 'hugo-book' (as described in the link above)
  • the two parameters BookTheme and BookSection should be in the params section (as shown in Configuration
    and as @McShelby mentioned , I’m not sure what the ‘*’ does, so I left that out.
theme = 'hugo-book'
[params]
   BookTheme = 'dark'
  • Menu - a little harder to track, I had to test it myself:

    stated in the Menu section

    By default, the theme will render pages from the content/docs section

    looks like empty pages are not considered as page - makes sense somehow. Just add some text to the page and you will get a menu entry.

=> doing this I get i nice dark theme with a menu listing the pages that have content.

what do you think?

@McShelby and @irkode, thank you very much for your help it is appreciated.

irkode thanks, my missing the theme = ‘hugo-book’, and the fact that BookTheme and BookSection settings needing to be in the [params] section was me being an idiot. I now have dark mode and I have Page 1 and Page 2 appearing in the left column. I don’t have 'test1 and test2 collapsible menu items but I guess I have to look elsewhere for that. I realise it will be something simple I have missed.

I will quickly add that I am and always was calm. I did notice a lot of obstructive responses to slightly daft noobish questions. I am a pentester. and am highly competent with computers/networking/active directory, but I have never attempted any web development. A web framework like hugo will inevitably attract non-experts given the nature of the technology. It saddens me when I see gatekeeper-t culture around inevitably noob-attracting computer tech. It seems more common these days, but maybe that is just me.

Anyway. Thanks very much for your help I do appreciate it.

All the best.