Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<.Site.Lastmod.IsZero>: can't evaluate field Lastmod in type page.Site #974

Closed
wagtale opened this issue Mar 12, 2024 · 7 comments
Closed

Comments

@wagtale
Copy link

wagtale commented Mar 12, 2024

What happened?

github.com/CaiJimmy/hugo-theme-stack/v3 not working on cloudflare pages after release 3.24.1

Hugo version

v0.123.8

Theme version

v3.24.1

What browsers are you seeing the problem on?

No response

More information about the browser

No response

Relevant log output

<pre class="c_sm c_bv c_ux c_jj c_uv c_uw c_db c_wf c_ze c_zf c_zg c_ge c_gf c_yt c_bx c_zh" style="box-sizing: border-box; border-radius: 0px; color: rgb(49, 49, 49); display: block; font-size: 12px; margin: 0px; overflow: auto; padding: 16px 32px; width: 1015px; background-color: rgb(242, 242, 242); border-width: 0px 0px 1px; border-style: solid; border-color: rgb(217, 217, 217); border-image: initial; font-family: monaco, courier, monospace; height: 500px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">
ERROR render of "section" failed: "/opt/buildhome/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!cai!jimmy/hugo-theme-stack/v3@v3.24.0/layouts/_default/baseof.html:4:12": execute of template failed: template: _default/list.html:4:12: executing "_default/list.html" at <partial "head/head.html" .>: error calling partial: "/opt/buildhome/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!cai!jimmy/hugo-theme-stack/v3@v3.24.0/layouts/partials/head/head.html:15:4": execute of template failed: template: partials/head/head.html:15:4: executing "partials/head/head.html" at <partial "head/opengraph/include.html" .>: error calling partial: "/opt/buildhome/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!cai!jimmy/hugo-theme-stack/v3@v3.24.0/layouts/partials/head/opengraph/include.html:1:3": execute of template failed: template: partials/head/opengraph/include.html:1:3: executing "partials/head/opengraph/include.html" at <partial "head/opengraph/provider/base" .>: error calling partial: "/opt/buildhome/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!cai!jimmy/hugo-theme-stack/v3@v3.24.0/layouts/partials/head/opengraph/provider/base.html:35:20": execute of template failed: template: partials/head/opengraph/provider/base.html:35:20: executing "partials/head/opengraph/provider/base.html" at <.Site.Lastmod.IsZero>: can't evaluate field Lastmod in type page.Site
--
14:59:37.051 | ERROR render of "term" failed: "/opt/buildhome/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!cai!jimmy/hugo-theme-stack/v3@v3.24.0/layouts/_default/baseof.html:4:12": execute of template failed: template: _default/list.html:4:12: executing "_default/list.html" at <partial "head/head.html" .>: error calling partial: "/opt/buildhome/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!cai!jimmy/hugo-theme-stack/v3@v3.24.0/layouts/partials/head/head.html:15:4": execute of template failed: template: partials/head/head.html:15:4: executing "partials/head/head.html" at <partial "head/opengraph/include.html" .>: error calling partial: "/opt/buildhome/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!cai!jimmy/hugo-theme-stack/v3@v3.24.0/layouts/partials/head/opengraph/include.html:1:3": execute of template failed: template: partials/head/opengraph/include.html:1:3: executing "partials/head/opengraph/include.html" at <partial "head/opengraph/provider/base" .>: error calling partial: "/opt/buildhome/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!cai!jimmy/hugo-theme-stack/v3@v3.24.0/layouts/partials/head/opengraph/provider/base.html:35:20": execute of template failed: template: partials/head/opengraph/provider/base.html:35:20: executing "partials/head/opengraph/provider/base.html" at <.Site.Lastmod.IsZero>: can't evaluate field Lastmod in type page.Site
14:59:37.051 | Total in 3112 ms
14:59:37.051 | Error: error building site: render: failed to render pages: render of "home" failed: "/opt/buildhome/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!cai!jimmy/hugo-theme-stack/v3@v3.24.0/layouts/_default/baseof.html:4:12": execute of template failed: template: index.html:4:12: executing "index.html" at <partial "head/head.html" .>: error calling partial: "/opt/buildhome/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!cai!jimmy/hugo-theme-stack/v3@v3.24.0/layouts/partials/head/head.html:15:4": execute of template failed: template: partials/head/head.html:15:4: executing "partials/head/head.html" at <partial "head/opengraph/include.html" .>: error calling partial: "/opt/buildhome/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!cai!jimmy/hugo-theme-stack/v3@v3.24.0/layouts/partials/head/opengraph/include.html:1:3": execute of template failed: template: partials/head/opengraph/include.html:1:3: executing "partials/head/opengraph/include.html" at <partial "head/opengraph/provider/base" .>: error calling partial: "/opt/buildhome/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!cai!jimmy/hugo-theme-stack/v3@v3.24.0/layouts/partials/head/opengraph/provider/base.html:35:20": execute of template failed: template: partials/head/opengraph/provider/base.html:35:20: executing "partials/head/opengraph/provider/base.html" at <.Site.Lastmod.IsZero>: can't evaluate field Lastmod in type page.Site
14:59:37.063 | Failed: Error while executing user command. Exited with error code: 1
14:59:37.073 | Failed: build command exited with code: 1
14:59:37.992 | Failed: error occurred while running build command
</pre>

Link to Minimal Reproducible Example

CaiJimmy/hugo-theme-stack

@DeepseaXX
Copy link

Same thing happened to me since v3.24

@DeepseaXX
Copy link

I don't know if it works for you, but after I tried to apply changes from this commit, and changed HUGO_VERSION: 0.123.8 in github\workflows\hugo.yml, it turns to work.

@CaiJimmy
Copy link
Owner

v0.123.8

This error should not appear if you are using Hugo version >= 0.123.0. Check the Hugo version you are using in CloudFlare Page building process.

@CaiJimmy
Copy link
Owner

I don't know if it works for you, but after I tried to apply changes from this commit, and changed HUGO_VERSION: 0.123.8 in github\workflows\hugo.yml, it turns to work.

By default, GitHub action pulls the latest version of Hugo. Fixing a specific version is not recommended to do.

@wagtale
Copy link
Author

wagtale commented Mar 13, 2024

Thanks changing the hugo version to 0.123.0 made it work.

@CaiJimmy CaiJimmy changed the title can't pull stack theme <.Site.Lastmod.IsZero>: can't evaluate field Lastmod in type page.Site Mar 13, 2024
@CaiJimmy CaiJimmy pinned this issue Mar 13, 2024
@lkaupp
Copy link

lkaupp commented Apr 22, 2024

For cloudflare pages, just manually specify the HUGO_VERSION variable in your environments: 0.125.3
Current version number can be found here: https://community.chocolatey.org/packages/hugo
@CaiJimmy thanks for pointing this one out. It seems CFP uses an old outdated version of hugo out-of-the-box and you have to specify the new one if you want to get the latest version.

@anemele
Copy link

anemele commented May 10, 2024

By default, GitHub action pulls the latest version of Hugo

I am sorry but the guide gives a fixed version: https://gohugo.io/hosting-and-deployment/hosting-on-github/#procedure at step 6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants