blist-hugo-theme
blist-hugo-theme copied to clipboard
Issue running the example site: can't evaluate field IsServer in type interface
When I run hugo serve --themesDir ../.. to try to run the example site, I get the following:
Start building sites …
hugo v0.111.3+extended linux/arm64 BuildDate=2023-03-16T08:41:31Z VendorInfo=debian:0.111.3-1
ERROR 2024/03/02 08:40:03 render of "page" failed: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/_default/baseof.html:3:6": execute of template failed: template: _default/single.html:3:6: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/partials/head.html:21:9": execute of template failed: template: partials/head.html:21:9: executing "partials/head.html" at <hugo>: can't evaluate field IsServer in type interface {}
ERROR 2024/03/02 08:40:03 render of "page" failed: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/_default/baseof.html:3:6": execute of template failed: template: _default/single.html:3:6: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/partials/head.html:21:9": execute of template failed: template: partials/head.html:21:9: executing "partials/head.html" at <hugo>: can't evaluate field IsServer in type interface {}
ERROR 2024/03/02 08:40:03 render of "page" failed: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/_default/baseof.html:3:6": execute of template failed: template: _default/single.html:3:6: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/partials/head.html:21:9": execute of template failed: template: partials/head.html:21:9: executing "partials/head.html" at <hugo>: can't evaluate field IsServer in type interface {}
ERROR 2024/03/02 08:40:03 render of "page" failed: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/_default/baseof.html:3:6": execute of template failed: template: _default/single.html:3:6: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/partials/head.html:21:9": execute of template failed: template: partials/head.html:21:9: executing "partials/head.html" at <hugo>: can't evaluate field IsServer in type interface {}
Error: Error building site: failed to render pages: render of "page" failed: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/_default/baseof.html:3:6": execute of template failed: template: _default/single.html:3:6: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/partials/head.html:21:9": execute of template failed: template: partials/head.html:21:9: executing "partials/head.html" at <hugo>: can't evaluate field IsServer in type interface {}
Built in 140 ms
Has anyone dealt with this/know how to fix it?
hi, you could try to remove lines starting from 21 till 30 in the /home/bronwynbiro/hugo-blog/themes/blist/layouts/partials/head.html. it worked for me.
I solved it by reverting the 21 line of themes/blist/layouts/partials/head.html among the changes in PR https://github.com/apvarun/blist-hugo-theme/pull/148
{{- if .Site.IsServer }}
But this seems like abnormal way. We need error fix or guidance for update.
hi, you could try to remove lines starting from 21 till 30 in the /home/bronwynbiro/hugo-blog/themes/blist/layouts/partials/head.html. it worked for me.
This solved the problem for me
For me this was an issue with the hugo version. you need at least v0.120.0 for the isServer flag to be set. On ubuntu the apt-repository version is way too old.
https://gohugo.io/functions/hugo/isserver/