Quick start + zen theme -> error

I’m going through quick start guide:

hugo new site quickstart
cd quickstart
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
echo "theme = 'ananke'" >> hugo.toml
hugo server

But I want to use other theme - one of first results in blog section: GitHub - frjo/hugo-theme-zen: A fast and clean Hugo base theme with css-grid and Hugo pipes support.

So I did:
submodule add https://github.com/frjo/hugo-theme-zen themes/zen
That was ok.
Next was
"theme = 'zen'" >> hugo.toml
Also good.

But hugo server
throws

ERROR render of "taxonomy" failed: ".......hugo/themes/zen/layouts/_default/baseof.html:36:40": execute of template failed: template: _default/list.html:36:40: executing "_default/list.html" at <partial "menu.html" .>: error calling partial:
".......hugo/themes/zen/layouts/partials/menu.html:15:78": execute of template failed: template: partials/menu.html:15:78: executing "partials/menu.html" at <.File.UniqueID>: error calling UniqueID: runtime error: invalid memory address or nil pointer dereference
Built in 39 ms
Error: error building site: render: failed to render pages: render of "home" failed: ".......hugo/themes/zen/layouts/_default/baseof.html:36:40": execute of template failed: template: index.html:36:40: executing "index.html" – File is nil; wrap it in if or with: {{ with partial "menu.html" .>: error calling partial: ".......hugo/themes/zen/layouts/partials/menu.html:15:78": execute of template failed: template: partials/menu.html:15:78: executing "partials/menu.html" at <.File }}{{ .UniqueID }}{{ end }}

What to do next?

hugo version
returns
hugo v0.132.1+extended linux/amd64 BuildDate=2024-08-13T10:10:10Z VendorInfo=brew

You need to add some content (like a home page) before trying to build the site.

hugo new site quickstart
cd quickstart/
git init
git submodule add https://github.com/frjo/hugo-theme-zen themes/hugo-theme-zen
echo "theme = 'hugo-theme-zen'" >> hugo.toml
hugo new content content/_index.md
hugo server -D

Works great.

2 Likes

@jmooring is correct.

The automatic menu generates an error when there is no content, never got around to fix that. Since I rarely have used the automatic menu myself I will likely remove it.

1 Like

@frjo @jmooring
Oh, much better. Thank You! Now I can explore further.

I just removed the automatic menu from the Zen theme, see Release 4.1.0 · frjo/hugo-theme-zen · GitHub.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.