I’m having this issue with multiple sites one using hugo-creator one using learn.
I’ve checked and the submodules are definitely installed.
I’m having this issue with multiple sites one using hugo-creator one using learn.
I’ve checked and the submodules are definitely installed.
Looks like you’ve already reached out to the theme author:
https://github.com/CloudWithChris/hugo-creator/discussions/122
To import a Hugo module (theme, content, etc.), the site itself must be a Hugo module.
In the root of your project:
hugo mod init something
tried that, still not working. I also completely recreated the site that uses hugo-creator and am still getting that error.
I did the same thing and had no problems.
I mean I justt did that to see if it would fix it. It’s the same server as I'm having trouble building my site (Pico theme) - #7 by SamGreenwood
And I am telling you, when I create a site from scratch using the creator theme, it works perfectly. But your project must be initialized as a Go module, using either (a) the command I posted above, or (b) the example site provided by the theme author (it already has a go.mod file in the root of the project).
I’m not sure what else to tell you.
would it be go mod init hugo-creator
or go mod init path/to/theme
?
go mod init anything
in the root of your project.
So in this case the themes dir?
update 2023-04-16T21:45:00Z I figure out what the issue with the Learn site was, I’d originally installed it as learn
and that’s how I called it in the config file but at somepoint I added the submodule which got added as `hugo-theme-learn’. I fixed it and now the site complies but checked the hugo-creator site and that issues isn’t present on that one.
Now I’m getting these errors (when I run the hugo command):
I replaced /home/sam/sitedir/themes/hugo-creator
with $theme
WARNING: calling IsSet with unsupported type "invalid" (<nil>)
will always return false
ERROR 2023/04/20 19:52:44 render of "page" failed:
"$them/layouts/_default/baseof.html:3:8":
execute of template failed:
template: _default/single.html:3:8:
executing "_default/single.html" at
<partial "site-metadata.html" .>: error calling partial:
"$theme/layouts/partials/site-metadata.html:14:19":
execute of template failed: template:
partials/site-metadata.html:14:19:
executing "partials/site-metadata.html" at
<partial "metadata/image-ld.html" .>: error calling partial:
"$theme/layouts/partials/metadata/image-ld.html:18:36":
execute of template failed: template:
partials/metadata/image-ld.html:18:36:
executing "partials/metadata/image-ld.html"
at <$content.Site.Params.content.site.ogimage>:
nil pointer evaluating resource.Resource.Permalink
ERROR 2023/04/20 19:52:44 render of "page" failed:
"$theme/layouts/_default/baseof.html:3:8":
execute of template failed:
template: _default/single.html:3:8: executing "_default/single.html"
at <partial "site-metadata.html" .>: error calling partial:
"$theme/layouts/partials/site-metadata.html:14:19":
execute of template failed: template:
partials/site-metadata.html:14:19:
executing "partials/site-metadata.html" at <partial
"metadata/image-ld.html" .>: error calling partial:
"$theme/layouts/partials/metadata/image-ld.html:18:36":
execute of template failed:
template: partials/metadata/image-ld.html:18:36:
executing "partials/metadata/image-ld.html" at
<$content.Site.Params.content.site.ogimage>:
nil pointer evaluating resource.Resource.Permalink
ERROR 2023/04/20 19:52:44 render of "page" failed:
"$theme/layouts/_default/baseof.html:3:8":
execute of template failed: template: _default/single.html:3:8:
executing "_default/single.html" at <partial "site-metadata.html" .>:
error calling partial:
"$theme/layouts/partials/site-metadata.html:14:19":
execute of template failed: template:
partials/site-metadata.html:14:19:
executing "partials/site-metadata.html" at
<partial "metadata/image-ld.html" .>:
error calling partial:
"$theme/layouts/partials/metadata/image-ld.html:18:36":
execute of template failed:
template: partials/metadata/image-ld.html:18:36:
executing "partials/metadata/image-ld.html" at
<$content.Site.Params.content.site.ogimage>:
nil pointer evaluating resource.Resource.Permalink
ERROR 2023/04/20 19:52:44 render of "page" failed:
"$theme/layouts/_default/baseof.html:3:8":
execute of template failed: template: _default/single.html:3:8:
executing "_default/single.html" at <partial "site-metadata.html" .>:
error calling partial:
"$theme/layouts/partials/site-metadata.html:14:19":
execute of template failed: template:
partials/site-metadata.html:14:19:
executing "partials/site-metadata.html" at
<partial "metadata/image-ld.html" .>:
error calling partial:
"$theme/layouts/partials/metadata/image-ld.html:18:36":
execute of template failed: template:
partials/metadata/image-ld.html:18:36:
executing "partials/metadata/image-ld.html" at
<$content.Site.Params.content.site.ogimage>:
nil pointer evaluating resource.Resource.Permalink
ERROR 2023/04/20 19:52:44 failed to render pages:
render of "page" failed: "$theme/layouts/_default/baseof.html:3:8":
execute of template failed: template: _default/404.html:3:8:
executing "_default/404.html" at <partial "site-metadata.html" .>:
error calling partial:
"$theme/layouts/partials/site-metadata.html:14:19":
execute of template failed: template:
partials/site-metadata.html:14:19:
executing "partials/site-metadata.html" at
<partial "metadata/image-ld.html" .>:
error calling partial:
"$theme/layouts/partials/metadata/image-
ld.html:18:36":
execute of template failed: template:
partials/metadata/image-ld.html:18:36:
executing "partials/metadata/image-ld.html
at <$content.Site.Params.content.site.ogimage>:
nil pointer evaluating resource.Resource.Permalink
Error: Error building site: TOCSS: failed to transform
"style.main.scss" (text/x-scss):
"/home/sam/sitedir/themes/hugo-creator/
@jmooring Still having issues with it. I did some digging and it looks like that last error is on lin that calls bootstrap/functions
but I can’t find where that is.
Please provide a link to your project repository.
I am attempting to rebuild it again. This time I’m gettig similar error but in the hugo cach instaed of the site directory.
See my previous comment.
go mod init
?
Here’s a link to the errors
I seem to have resolved some of the issues. now I get only the following errors:
$hugo-module-filecache = /tmp/hugo_cache/modules/filecache/modules
$github = github.com/cloudwithchris/hugo-creator@v0.0.27-0.20220911012120-e40988e0ccc9
WARNING: calling IsSet with unsupported type
"invalid" (<nil>) will always return false.
WARN 2023/04/29 18:18:42 .File.UniqueID on zero object.
Wrap it in if or with: {{ with .File }}{{ .UniqueID }}{{ end }}
ERROR 2023/04/29 18:18:42 failed to render pages:
render of "page" failed:
"$hugo-module-filecache/$github/layouts/_default/search.html:55:8":
execute of template failed: template: _default/search.html:55:8:
executing "main" at <$.Scratch.Add>:
error calling Add: reflect: call of reflect.
Value.Type on zero Value
Error: Error building site: TOCSS:
failed to transform "style.main.scss" (text/x-scss):
"$hugo-module-filecache/$github/assets/sass/main.scss:4:1":
File to import not found or unreadable: bootstrap/functions.
Still getting those errors but the site is now accessible.