I have been trying to deploy a website created as a new project in RStudio, I’m using the Academic-theme. Trying to deploy from Gitlab to Netlify, I have encountered an error that hasn’t allowed me to deploy my build. Have read many forums about this common “build returned non-zero exit code: 255” error, but none of the suggestions seems to work:
Well there is a specific ERROR message in the deploy log you posted.
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
The Academic Theme requires Hugo 0.58.0 as a minimum.
Have you defined the Hugo version that is used in the Netlify Build?
I do not see a netlify.toml in your repo.
Have you set up the Hugo version in the Netlify admin panel?
It seems that the build fails because it uses the default Hugo version installed in the Netlify build image i.e. Hugo 0.54 extended (according to the deploy log).
Normally on other queries everyone has two blanks for the build command, so normally I see e.g. “HUGO_VERSION 0.58.0” in two sections so I’m not quite sure if the version I’m establishing is actually working:
Typically the netlify.toml resides under the root of the project that is going to be deployed.
It doesn’t seem like it is inherited from the root of the themes/academic directory -as you describe-.
Also note that your question may get a better answer at the Netlify forum or the Academic chat, since this is related to the deployment of that particular theme.
Or ask the author of Academic to provide better documentation regarding the deployment of the Academic theme on Netlify.