forestryio / novela-hugo-starter

Novela, the simplest way to start publishing with Hugo and Forestry.

Home Page:https://hugo-novela-forestry.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed netlify deploy when using Forestry's import function

NZ42 opened this issue · comments

commented

Hi,
I'm currently having problems when attempting to deploy a novela blog through Forestry's import function. Here is my process:

  • https://forestry.io/starters/ brings me to "Create a Site", using template git@github.com:forestryio/novela-hugo-starter.git. The template is correctly imported in forestry.
    -In Netlify, I add a new site from Git, choosing the just created git repository. The Build command I use is hugo --minify, while Publish directory is set to public. Unfortunately, deploying fails soon thereafter with the following error:

5:47:37 PM: Build ready to start
5:47:39 PM: build-image version: 9cade8af58c2cf3a17a1e9433d2e979149488837
5:47:39 PM: build-image tag: v3.3.5
5:47:39 PM: buildbot version: 2d05064ce3dd2eb95d282a24602ab707dd9581e8
5:47:39 PM: Fetching cached dependencies
5:47:39 PM: Failed to fetch cache, continuing with build
5:47:39 PM: Starting to prepare the repo for build
5:47:40 PM: No cached dependencies found. Cloning fresh repo
5:47:40 PM: git clone git@gitlab.com:just_created_repository_from_forestry
5:47:42 PM: Preparing Git Reference refs/heads/master
5:47:43 PM: Starting build script
5:47:44 PM: Installing dependencies
5:47:45 PM: Downloading and installing node v10.18.0...
5:47:45 PM: Downloading https://nodejs.org/dist/v10.18.0/node-v10.18.0-linux-x64.tar.xz...
5:47:46 PM: #####################
5:47:46 PM: 29.5%
5:47:46 PM: #######################
5:47:46 PM: ################################################# 100.0%
5:47:46 PM: Computing checksum with sha256sum
5:47:46 PM: Checksums matched!
5:47:48 PM: Now using node v10.18.0 (npm v6.13.4)
5:47:49 PM: Attempting ruby version 2.6.2, read from environment
5:47:50 PM: Using ruby version 2.6.2
5:47:50 PM: Using PHP version 5.6
5:47:50 PM: Started restoring cached go cache
5:47:50 PM: Finished restoring cached go cache
5:47:50 PM: unset GOOS;
5:47:50 PM: unset GOARCH;
5:47:50 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
5:47:50 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
5:47:50 PM: go version >&2;
5:47:50 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
5:47:50 PM: go version go1.12 linux/amd64
5:47:50 PM: Installing missing commands
5:47:50 PM: Verify run directory
5:47:50 PM: Executing user command: hugo --minify
5:47:50 PM: Error: "/opt/build/repo/themes/novela/layouts/partials/func/GetArticleAuthors.html:39:1": parse failed: template: partials/func/GetArticleAuthors.html:39: function "return" not defined
5:47:50 PM: Skipping functions preparation step: no functions directory set
5:47:50 PM: Caching artifacts
5:47:50 PM: Started saving pip cache
5:47:50 PM: Finished saving pip cache
5:47:50 PM: Started saving emacs cask dependencies
5:47:50 PM: Finished saving emacs cask dependencies
5:47:50 PM: Started saving maven dependencies
5:47:51 PM: Finished saving maven dependencies
5:47:51 PM: Started saving boot dependencies
5:47:51 PM: Finished saving boot dependencies
5:47:51 PM: Started saving go dependencies
5:47:51 PM: Finished saving go dependencies
5:47:53 PM: Error running command: Build script returned non-zero exit code: 255
5:47:53 PM: Failing build: Failed to build site
5:47:53 PM: failed during stage 'building site': Build script returned non-zero exit code: 255
5:47:53 PM: Finished processing build request in 14.547300709s

This happens using both GitLab and GitHub.

Disclaimer: I'm a complete beginner, so it is quite probable I made a silly mistake. In any case, I haven't been able to find a solution. Any help is appreciated.

As you can see this theme deploys fine on Netlify: https://hugo-novela-forestry.netlify.com

According to the build error, it's related to the authors:

Error: "/opt/build/repo/themes/novela/layouts/partials/func/GetArticleAuthors.html:39:1": parse failed: template: partials/func/GetArticleAuthors.html:39: function "return" not defined

Did you follow the docs?
https://github.com/forestryio/novela-hugo-starter#authors

Did you save a post without authors?

Hi DirtyF,

I'm having the same build fail when deploying.

I've tried a) direct from Forestry as mandorlaz mentions and also separately b) cloned the repository and then both times followed the instructions 'Deployment and hosting with Netlify' in the Readme without modification to any files.

Would you be able to provide some more detail on what regarding the authors could be causing this problem or what we should change.

Cheers.

I am having the same issue.
I have even deleted all the posts and authors, tried to see, but nothing worked
I even created a new author. Still nothing.

Same issue as well, did the same steps as stephenajulu

Error: "/opt/build/repo/themes/novela/layouts/partials/func/GetArticleAuthors.html:39:1": parse failed: template: partials/func/GetArticleAuthors.html:39: function "return" not defined

All I did was import the site through forestry and linked it with gitlab and netlify.

Found the issue: On netlify you need to go into deploy settings - build & deploy - environment and set HUGO_VERSION and 0.63.1 as the variables, you would think its smart enough to know its deploying a hugo site but apparently not.

Novela theme requires at least Hugo 0.55 as it's using partial returns, we added a netlify.toml file in the theme repository for Netlify to build the site without errors.