Compilation Error

Dear All,

I’m new on HUGO and has no experience on. I have to change the hosting for a reason of our website which is actually on AWS. the former it send to me the source of the website and told me he is on v0.8. When I launch the site to compile the public folder I’m getting following errors:

ERROR 2023/04/19 17:03:55 render of “page” failed: “C:\Hugo\bin\front_2019\themes\asinternational\layouts_default\baseof.html:6:31”: execute of template failed: template: _default/single.html:6:31: executing “site/meta” at <partial “site/meta.html” .>: error calling partial: “C:\Hugo\bin\front_2019\themes\asinternational\layouts\partials\site\meta.html:6:8”: execute of template failed: template: partials/site/meta.html:6:8: executing “partials/site/meta.html” at <.Hugo.Generator>: can’t evaluate field Hugo in type *hugolib.pageState

I have looked over the different forums but didn’t managed to solve it.

I have released in baseof.html .URL by .RelPermalink but still get following error:

Start building sites …
hugo v0.111.3-5d4eb5154e1fed125ca8e9b5a0315c4180dab192+extended windows/amd64 BuildDate=2023-03-12T11:40:50Z VendorInfo=gohugoio
ERROR 2023/04/19 17:23:11 render of “page” failed: “C:\Hugo\bin\front_2019\themes\asinternational\layouts_default\baseof.html:6:31”: execute of template failed: template: _default/single.html:6:31: executing “site/meta” at <partial “site/meta.html” .>: error calling partial: “C:\Hugo\bin\front_2019\themes\asinternational\layouts\partials\site\meta.html:6:8”: execute of template failed: template: partials/site/meta.html:6:8: executing “partials/site/meta.html” at <.Hugo.Generator>: can’t evaluate field Hugo in type *hugolib.pageState
ERROR 2023/04/19 17:23:11 render of “page” failed: “C:\Hugo\bin\front_2019\themes\asinternational\layouts_default\baseof.html:6:31”: execute of template failed: template: _default/single.html:6:31: executing “site/meta” at <partial “site/meta.html” .>: error calling partial: “C:\Hugo\bin\front_2019\themes\asinternational\layouts\partials\site\meta.html:6:8”: execute of template failed: template: partials/site/meta.html:6:8: executing “partials/site/meta.html” at <.Hugo.Generator>: can’t evaluate field Hugo in type *hugolib.pageState
ERROR 2023/04/19 17:23:11 render of “page” failed: “C:\Hugo\bin\front_2019\themes\asinternational\layouts_default\baseof.html:6:31”: execute of template failed: template: _default/single.html:6:31: executing “site/meta” at <partial “site/meta.html” .>: error calling partial: “C:\Hugo\bin\front_2019\themes\asinternational\layouts\partials\site\meta.html:6:8”: execute of template failed: template: partials/site/meta.html:6:8: executing “partials/site/meta.html” at <.Hugo.Generator>: can’t evaluate field Hugo in type *hugolib.pageState
ERROR 2023/04/19 17:23:11 render of “page” failed: “C:\Hugo\bin\front_2019\themes\asinternational\layouts_default\baseof.html:6:31”: execute of template failed: template: _default/single.html:6:31: executing “site/meta” at <partial “site/meta.html” .>: error calling partial: “C:\Hugo\bin\front_2019\themes\asinternational\layouts\partials\site\meta.html:6:8”: execute of template failed: template: partials/site/meta.html:6:8: executing “partials/site/meta.html” at <.Hugo.Generator>: can’t evaluate field Hugo in type *hugolib.pageState
Error: Error building site: failed to render pages: render of “page” failed: “C:\Hugo\bin\front_2019\themes\asinternational\layouts_default\baseof.html:6:31”: execute of template failed: template: _default/single.html:6:31: executing “site/meta” at <partial “site/meta.html” .>: error calling partial: “C:\Hugo\bin\front_2019\themes\asinternational\layouts\partials\site\meta.html:6:8”: execute of template failed: template: partials/site/meta.html:6:8: executing “partials/site/meta.html” at <.Hugo.Generator>: can’t evaluate field Hugo in type *hugolib.pageState
Built in 1026 ms

Do you have any idea about the solution?

1 Like

The .Hugo method was deprecated, replaced by the global hugo function.

https://gohugo.io/functions/hugo

By default[1], Hugo injects this in your home page:

<meta name=generator content="Hugo n.n.n">

So unless you want to inject the version on every page, you can remove the meta element from your template.


  1. Assuming that disableHugoGeneratorInject is false or not present in your site configuration. ↩︎

Dear jmooring,

thank you for your help. I haven’t found such strings in html’s. But, I have replaced .Hugo.Generator by hugo.Generator and now I have an issue with:

hugo v0.111.3-5d4eb5154e1fed125ca8e9b5a0315c4180dab192+extended windows/amd64 BuildDate=2023-03-12T11:40:50Z VendorInfo=gohugoio
ERROR 2023/04/19 23:24:41 render of “page” failed: “C:\Hugo\bin\front_2019\themes\asinternational\layouts_default\baseof.html:52:62”: execute of template failed: template: blog/single.html:52:62: executing “blog/single.html” at <.Dir>: can’t evaluate field Dir in type *hugolib.pageState
ERROR 2023/04/19 23:24:41 render of “page” failed: “C:\Hugo\bin\front_2019\themes\asinternational\layouts_default\baseof.html:52:62”: execute of template failed: template: _default/single.html:52:62: executing “_default/single.html” at <.Dir>: can’t evaluate field Dir in type *hugolib.pageState
ERROR 2023/04/19 23:24:41 render of “page” failed: “C:\Hugo\bin\front_2019\themes\asinternational\layouts_default\baseof.html:52:62”: execute of template failed: template: _default/single.html:52:62: executing “_default/single.html” at <.Dir>: can’t evaluate field Dir in type *hugolib.pageState
ERROR 2023/04/19 23:24:41 render of “page” failed: “C:\Hugo\bin\front_2019\themes\asinternational\layouts_default\baseof.html:52:62”: execute of template failed: template: _default/single.html:52:62: executing “_default/single.html” at <.Dir>: can’t evaluate field Dir in type *hugolib.pageState
Error: Error building site: failed to render pages: render of “page” failed: “C:\Hugo\bin\front_2019\themes\asinternational\layouts_default\baseof.html:52:62”: execute of template failed: template: contact/single.html:52:62: executing “contact/single.html” at <.Dir>: can’t evaluate field Dir in type *hugolib.pageState
Total in 2224 ms

Do you have any idea?

Please share your repository. Otherwise I fear that we’ll be going back and forth forever. Your site was last built with a very old version, and many things have changed.

Dear jmooring,

would you please detail how to share the repository?

Upgrading your very old site to be compatible with the current version of Hugo is going to take some time and expertise. As Hugo is quite new to you, perhaps it would be better if you installed the earlier version.

https://github.com/gohugoio/hugo/releases/tag/v0.8

1 Like