nicokaiser / hugo-theme-gallery

Gallery Theme for Hugo
https://nicokaiser.github.io/hugo-theme-gallery/
MIT License
352 stars 103 forks source link

Error: function "page" not defined #16

Closed clemsau closed 1 year ago

clemsau commented 1 year ago

When trying to serve my website with this theme, I am getting the following error:

Error: add site dependencies: load resources: loading templates: "/<path-to-the-site>/themes/hugo-theme-gallery/layouts/partials/menu.html:12:1": parse failed: template: partials/menu.html:12: function "page" not defined

But as far as I know, page.Page is a type. So I doubt my issue is having anything to do with the theme by itself, but otherwise, have you already encountered this issue ?

Also, when trying to solve the issue and removing the 4 instances of page in the layouts/partials/menu.html template. I end up getting another error:

template: _default/sitemap.xml:7:34: executing "_default/sitemap.xml" at <.Ancestors.Reverse>: can't evaluate field Ancestors in type page.Page

This makes me think I actually might have an issue with my installation of Go, but your opinion is welcome as I run other hugo theme without any issues.

Thanks for your help!

nicokaiser commented 1 year ago

What version of Hugo are you using? The theme requires Hugo >= 0.112, could you check if maybe you are running an older version?

clemsau commented 1 year ago

Indeed, I was using hugo v0.98.0.

It is working as intended now, great theme!

I don't see the version requirement anywhere, do you have any documentation for it ? So people don't meet this issue in the future.

I would advise adding it in the README directly.

Thanks!

nicokaiser commented 1 year ago

The minimum requirement is in the 'theme.toml' file, I thought that might be enough for Hugo to complain if it is not met. But I will add this to README as well.