Closed nvelden closed 5 years ago
Without really knowing why you get this error, I suspect you have an older hugo version installed. If you report your hugo and Academic versions we can check.
I have version 0.55.6 installed:
> blogdown::hugo_version()
[1] ‘0.55.6’
I installed Academic with Rstudio after following all the step in the tutorial with the command:
blogdown::new_site(theme = "gcushen/hugo-academic", theme_example = TRUE)
The strange thing is if I drag the public folder in netlify from my directory it works fine. If I link it via github I get the error. Do I miss some files in my github directory? https://github.com/nvelden/hugo_website
You are running that version locally, but not on Netlify. The public folder rendering in Netlify is not strange at all! That shows that your local site build is good, but Netlify cannot build your site. You need to tell Netlify how: https://alison.rbind.io/post/2019-02-19-hugo-netlify-toml/ https://summer-of-blogdown.netlify.com/day-02/
Thank you so much for your tutorials they are great! I am just a bit confused... How do I create a .toml file? Is there a command for this or can I just do it in the notepad? Where should I add the file? In the public folder or in the project folder?
It goes in the project root folder:
https://summer-of-blogdown.netlify.com/02/#28
Try looking at the academic theme repo: https://github.com/sourcethemes/academic-kickstart
[build]
command = "hugo --gc --minify -b $URL"
publish = "public"
[build.environment]
HUGO_VERSION = "0.55.6"
HUGO_ENABLEGITINFO = "true"
[context.production.environment]
HUGO_ENV = "production"
[context.deploy-preview]
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
[context.branch-deploy]
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
Thank you so much! It worked.
In case you encounter this error for deploy previews when checking a pull request on github, you can add the following lines to @apreshill's example netlify.toml
file:
[context.deploy-preview.environment]
HUGO_VERSION = "0.55.6"
I'm trying to learn from this post and follow all the suggestions but I can't see the answer to a very similar problem.. https://github.com/gcushen/hugo-academic/issues/1453
You are running that version locally, but not on Netlify. The public folder rendering in Netlify is not strange at all! That shows that your local site build is good, but Netlify cannot build your site. You need to tell Netlify how: https://alison.rbind.io/post/2019-02-19-hugo-netlify-toml/ https://summer-of-blogdown.netlify.com/day-02/
i have follow your instruction, but still get failed deploy ??
can help my problem ?
Hi, I had the same issue, and got this, which worked. Perfect. Thanks for your answers. Thanks for the question by @nvelden
Same issue here, I already have netlify.toml file and matched the latest version on both the GitHub version and R studio version. Deploys when dragging public folder but doesn't when deployed via github.9:34:41 PM: Build ready to start 9:34:43 PM: build-image version: 2dbd444fcdce00cf06325060a8238d5ae3e86774 9:34:43 PM: build-image tag: v3.3.7 9:34:43 PM: buildbot version: d305548225ac57bb00eb5a596b0b8674e76a4681 9:34:43 PM: Fetching cached dependencies 9:34:43 PM: Starting to download cache of 254.9KB 9:34:43 PM: Finished downloading cache in 91.458427ms 9:34:43 PM: Starting to extract cache 9:34:43 PM: Failed to fetch cache, continuing with build 9:34:43 PM: Starting to prepare the repo for build 9:34:43 PM: No cached dependencies found. Cloning fresh repo 9:34:43 PM: git clone https://github.com/paudelnabin/website 9:34:44 PM: Preparing Git Reference refs/heads/master 9:34:45 PM: Starting build script 9:34:45 PM: Installing dependencies 9:34:46 PM: Downloading and installing node v10.20.1... 9:34:47 PM: Downloading https://nodejs.org/dist/v10.20.1/node-v10.20.1-linux-x64.tar.xz... 9:34:47 PM: ######################################## 9:34:47 PM: 56.4% 9:34:47 PM: ########################################### 9:34:47 PM: ############################# 100.0% 9:34:47 PM: Computing checksum with sha256sum 9:34:47 PM: Checksums matched! 9:34:50 PM: Now using node v10.20.1 (npm v6.14.4) 9:34:50 PM: Attempting ruby version 2.6.2, read from environment 9:34:51 PM: Using ruby version 2.6.2 9:34:52 PM: Using PHP version 5.6 9:34:52 PM: Started restoring cached go cache 9:34:52 PM: Finished restoring cached go cache 9:34:52 PM: unset GOOS; 9:34:52 PM: unset GOARCH; 9:34:52 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64'; 9:34:52 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}"; 9:34:52 PM: go version >&2; 9:34:52 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env'; 9:34:52 PM: go version go1.12 linux/amd64 9:34:52 PM: Installing missing commands 9:34:52 PM: Verify run directory 9:34:52 PM: Executing user command: hugo 9:34:52 PM: Error: "/opt/build/repo/themes/hugo-academic/layouts/partials/functions/get_address.html:21:1": parse failed: template: partials/functions/get_address.html:21: function "return" not defined 9:34:52 PM: Skipping functions preparation step: no functions directory set 9:34:52 PM: Caching artifacts 9:34:52 PM: Started saving pip cache 9:34:52 PM: Finished saving pip cache 9:34:52 PM: Started saving emacs cask dependencies 9:34:52 PM: Finished saving emacs cask dependencies 9:34:52 PM: Started saving maven dependencies 9:34:52 PM: Finished saving maven dependencies 9:34:52 PM: Started saving boot dependencies 9:34:52 PM: Finished saving boot dependencies 9:34:52 PM: Started saving go dependencies 9:34:52 PM: Finished saving go dependencies 9:34:57 PM: Error running command: Build script returned non-zero exit code: 255 9:34:57 PM: Failing build: Failed to build site 9:34:57 PM: failed during stage 'building site': Build script returned non-zero exit code: 255 9:34:57 PM: Finished processing build request in 14.517197107s
@paudelnabin
1/3) Create a file "netlify.toml" and paste:
[build]
command = "hugo --gc --minify -b $URL"
publish = "public"
[build.environment]
HUGO_VERSION = "0.69.0"
HUGO_ENABLEGITINFO = "true"
[context.production.environment]
HUGO_ENV = "production"
[context.deploy-preview]
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
[context.branch-deploy]
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
2/3) Make sure your file "config.toml" has the same version as "netlify.toml"
looks like this:
baseURL = "https://giotissl.netlify.app/"
languageCode = "en-us"
summaryLength = "10"
theme = "kross-hugo"
title = "Kross | Hugo Portfolio Template"
[[menu.main]]
URL = "about"
name = "About"
weight = 2
[[menu.main]]
URL = "blog"
name = "Blog"
weight = 3
[[menu.main]]
URL = "portfolio"
name = "Portfolio"
weight = 4
[[menu.main]]
URL = "contact"
name = "Contact"
weight = 5
[params]
address = "125/A, CA Commercial Area, California, USA"
author = "Johnathan Smith"
copyright = "Copyrighht © 2020 a theme by [gethugothemes](https://gethugothemes.com)"
description = "This is meta description"
email = "steve.fruits@email.com"
google_analitycs_id = "Your ID"
home = "Home"
logo = "images/logo.png"
phone = "+880 2544 658 256"
theme_color = "#41228e"
[params.contact]
enable = true
form_action = "#"
[[params.plugins.css]]
URL = "plugins/bootstrap/bootstrap.min.css"
[[params.plugins.css]]
URL = "plugins/slick/slick.css"
[[params.plugins.css]]
URL = "plugins/themify-icons/themify-icons.css"
[[params.plugins.js]]
URL = "plugins/jQuery/jquery.min.js"
[[params.plugins.js]]
URL = "plugins/bootstrap/bootstrap.min.js"
[[params.plugins.js]]
URL = "plugins/slick/slick.min.js"
[[params.plugins.js]]
URL = "plugins/shuffle/shuffle.min.js"
[params.preloader]
enable = true
preloader = ""
[[params.social]]
URL = "#"
icon = "ti-facebook"
[[params.social]]
URL = "#"
icon = "ti-instagram"
[[params.social]]
URL = "#"
icon = "ti-dribbble"
[[params.social]]
URL = "#"
icon = "ti-twitter-alt"
3/3) Go to https://app.netlify.com/sites/giotissl/settings/deploys
General >> Site details:
Click "Change site name"
make sure your netlify.toml has the same value as your site name, for example:
baseURL = "https://giotissl.netlify.app/"
General >> Build & deploy >> "Edit settings"
Build command: hugo server --themesDir ../..
Publish directory: public
Then go to https://app.netlify.com/sites/giotissl/deploys At the right side, click "Trigger deploy" then "Clear cache and deploy site"
Hope it helps!
I'd like to add little simplifications to the corrections done so far since I'm a very novice user and it took me a while to add and understand all the changes proposed by @giotissl. This in order to maybe save time and trouble to someone as novice as me of the difficulties I found during the application of the corrections giotissl did.
Thanks to @giotissl for the solution to this error.
I also notice the same issue after I uploaded the files to GitHub and try to deploy. I have got the following: 10:16:14 AM: Build ready to start 10:16:15 AM: build-image version: 8e315e54bc4032a32e73290be556cde4f8348c12 10:16:15 AM: build-image tag: v2.8.2 10:16:15 AM: buildbot version: 45cd00068410d70db72c9672cdd014995488e12a 10:16:16 AM: Fetching cached dependencies 10:16:16 AM: Failed to fetch cache, continuing with build 10:16:16 AM: Starting to prepare the repo for build 10:16:16 AM: No cached dependencies found. Cloning fresh repo 10:16:16 AM: git clone https://github.com/pkwijekoon/pwappblog 10:16:17 AM: Preparing Git Reference refs/heads/master 10:16:18 AM: Starting build script 10:16:18 AM: Installing dependencies 10:16:19 AM: Downloading and installing node v8.17.0... 10:16:19 AM: Downloading https://nodejs.org/dist/v8.17.0/node-v8.17.0-linux-x64.tar.xz... 10:16:19 AM: ############## 10:16:19 AM: 19.8% 10:16:20 AM: ############################################### 10:16:20 AM: ######################### 100.0% 10:16:20 AM: Computing checksum with sha256sum 10:16:20 AM: Checksums matched! 10:16:22 AM: Now using node v8.17.0 (npm v6.13.4) 10:16:22 AM: Attempting ruby version 2.3.6, read from environment 10:16:23 AM: Using ruby version 2.3.6 10:16:23 AM: Using PHP version 5.6 10:16:23 AM: Installing Hugo 0.49 10:16:24 AM: Hugo Static Site Generator v0.49 linux/amd64 BuildDate: 2018-09-24T10:03:17Z 10:16:24 AM: Started restoring cached go cache 10:16:24 AM: Finished restoring cached go cache 10:16:24 AM: Installing Go version 1.10 10:16:29 AM: unset GOOS; 10:16:29 AM: unset GOARCH; 10:16:29 AM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64'; 10:16:29 AM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64/bin:${PATH}"; 10:16:29 AM: go version >&2; 10:16:29 AM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.10.linux.amd64.env" 10:16:29 AM: go version go1.10 linux/amd64 10:16:29 AM: Installing missing commands 10:16:29 AM: Verify run directory 10:16:29 AM: Executing user command: hugo 10:16:29 AM: Building sites … 10:16:29 AM: Total in 324 ms 10:16:29 AM: Error: Error building site: Prepare pages failed: ["template: __7f15e53e3fff89c15ccbe688ca30fbe4:3757: unexpected bad character U+0026 '&' in parenthesi"]… 10:16:29 AM: Skipping functions preparation step: no functions directory set 10:16:29 AM: Caching artifacts 10:16:29 AM: Started saving pip cache 10:16:29 AM: Finished saving pip cache 10:16:29 AM: Started saving emacs cask dependencies 10:16:29 AM: Finished saving emacs cask dependencies 10:16:29 AM: Started saving maven dependencies 10:16:29 AM: Finished saving maven dependencies 10:16:29 AM: Started saving boot dependencies 10:16:29 AM: Finished saving boot dependencies 10:16:29 AM: Started saving go dependencies 10:16:30 AM: Finished saving go dependencies 10:16:33 AM: Error running command: Build script returned non-zero exit code: 255 10:16:33 AM: Failing build: Failed to build site 10:16:33 AM: failed during stage 'building site': Build script returned non-zero exit code: 255 10:16:33 AM: Finished processing build request in 17.761124841s
I am following the https://alison.rbind.io/post/2017-06-12-up-and-running-with-blogdown/ tutorial to get my website running via Netlify.
I downloaded the theme and build the website using Rblogdown. I pushed the directory to github: https://github.com/nvelden/hugo_website.
When I try to publish via Netlify I get an exit code 255:
Does anybody have an idea what goes wrong? When I drag the public directory from my computer into netlify it is published without any problems.