Hi everyone
I’m trying to set up a personal website using hugo (researcher theme) and deploy with Github Pages. I have succeed building the webpage many times. But after I updated a blog, the deployment failed…
The hugo environement is as:
hugo v0.118.1-0eb480aa1d06653803175e3fdfad5dbf5fc26f9b+extended linux/amd64 BuildDate=2023-08-31T09:42:31Z VendorInfo=gohugoio
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.21.0"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.2.4"
On my computer, the command hugo server -D
succeeds and the content is same as what I wrote.
root@Xinkai-Thinkpad:/mnt/c/Users/Xinkai Wang/Documents/Coding Files/Wang-Xinkai.github.io# hugo server -D
Watching for changes in /mnt/c/Users/Xinkai Wang/Documents/Coding Files/Wang-Xinkai.github.io/{archetypes,content,data,layouts,static,themes}
Watching for config changes in /mnt/c/Users/Xinkai Wang/Documents/Coding Files/Wang-Xinkai.github.io/config.toml
Start building sites …
hugo v0.118.1-0eb480aa1d06653803175e3fdfad5dbf5fc26f9b+extended linux/amd64 BuildDate=2023-08-31T09:42:31Z VendorInfo=gohugoio
| EN
-------------------+-----
Pages | 11
Paginator pages | 0
Non-page files | 0
Static files | 87
Processed images | 0
Aliases | 0
Sitemaps | 1
Cleaned | 0
Built in 1620 ms
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
But when I want to generate a static page using hugo -d docs
, it failed and the files in the docs
directory is not same as the content
directory.
root@Xinkai-Thinkpad:/mnt/c/Users/Xinkai Wang/Documents/Coding Files/Wang-Xinkai.github.io# hugo -d docs
Start building sites …
hugo v0.118.1-0eb480aa1d06653803175e3fdfad5dbf5fc26f9b+extended linux/amd64 BuildDate=2023-08-31T09:42:31Z VendorInfo=gohugoio
ERROR render of "page" failed: "/mnt/c/Users/Xinkai Wang/Documents/Coding Files/Wang-Xinkai.github.io/themes/researcher/layouts/_default/baseof.html:15:12": execute of template failed: template: _default/single.html:15:12: executing "_default/single.html" at <partial "consent.html" .>: error calling partial: "/mnt/c/Users/Xinkai Wang/Documents/Coding Files/Wang-Xinkai.github.io/themes/researcher/layouts/partials/consent.html:50:50": execute of template failed: template: partials/consent.html:50:50: executing "partials/consent.html" at <where .Site.Data.consent.items "is_functional" false>: error calling where: can't iterate over <nil>
ERROR render of "home" failed: "/mnt/c/Users/Xinkai Wang/Documents/Coding Files/Wang-Xinkai.github.io/themes/researcher/layouts/_default/baseof.html:15:12": execute of template failed: template: index.html:15:12: executing "index.html" at <partial "consent.html" .>: error calling partial: "/mnt/c/Users/Xinkai Wang/Documents/Coding Files/Wang-Xinkai.github.io/themes/researcher/layouts/partials/consent.html:50:50": execute of template failed: template: partials/consent.html:50:50: executing "partials/consent.html" at <where .Site.Data.consent.items "is_functional" false>: error calling where: can't iterate over <nil>
Total in 29412 ms
Error: error building site: render: failed to render pages: render of "page" failed: "/mnt/c/Users/Xinkai Wang/Documents/Coding Files/Wang-Xinkai.github.io/themes/researcher/layouts/_default/baseof.html:15:12": execute of template failed: template: _default/single.html:15:12: executing "_default/single.html" at <partial "consent.html" .>: error calling partial: "/mnt/c/Users/Xinkai Wang/Documents/Coding Files/Wang-Xinkai.github.io/themes/
I’ve searched for the reason and check the corresponding file. But changing .Site
to self.Site
or site
does not work.
consent.html:50: const scripts = [];{{ range $index, $item := (where .Site.Data.consent.items "is_functional" false) }}
Oh, there was ERROR on render of ‘taxonomy’ failed. I solved it by adding disableKinds = ["taxonomy", "term"]
in the config.toml
. But I cannot add page
here, which resulted in the failed construction of all pages.
I’d appreciate it if someone could offer me some advice on the problem and how to fix it.
Thanks a lot!