作者:等待那个心中的人_212 | 来源:互联网 | 2024-10-16 13:09
Hello,
I created a web site using Hugo v0.55.6 using the Academic template in RStudio 1.2.1335.
I pushed it to my public git repository: https://gitlab.com/ogurcan/web-site
Then I used Netlify for deploying it, however I am getting the following error message:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| ...
3:30:08 PM: Executing user command: hugo
3:30:08 PM: Error: "/opt/build/repo/themes/hugo-academic/layouts/partials/functions/get_pub_types.html:6:1": parse failed: template: partials/functions/get_pub_types.html:6: function "return" not defined
3:30:08 PM: Skipping functions preparation step: no functions directory set
3:30:08 PM: Caching artifacts
3:30:08 PM: Started saving pip cache
3:30:08 PM: Finished saving pip cache
3:30:08 PM: Started saving emacs cask dependencies
3:30:08 PM: Finished saving emacs cask dependencies
3:30:08 PM: Started saving maven dependencies
3:30:08 PM: Finished saving maven dependencies
3:30:08 PM: Started saving boot dependencies
3:30:08 PM: Finished saving boot dependencies
3:30:08 PM: Started saving go dependencies
3:30:08 PM: Finished saving go dependencies
3:30:11 PM: Error running command: Build script returned non-zero exit code: 255
3:30:11 PM: Failing build: Failed to build site
3:30:11 PM: failed during stage 'building site': Build script returned non-zero exit code: 255
3:30:11 PM: Finished processing build request in 17.132256045s
3:30:11 PM: Shutting down logging, 0 messages pending |
I discovered that Netlify is using Hugo Static Site Generator v0.54.0-B1A82C61A. I don't know if the problem arises because of this.
Any ideas?
该提问来源于开源项目:wowchemy/wowchemy-hugo-modules
And just to be clear:
- Go to your Netlify account
- Select the site
- Select Deploys
- Open Deploy Settings
- Add an Environment Variable, e.g.
1
| HUGO_VERSION=0.76.5 |
It should look like this when you're done: