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.
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.
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
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:
@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.