I’m trying to run a site through GitLab pages using Academic 4.6 theme, which requires Hugo Extended v0.58.3+, which I’m running locally.
It seems that GitLab pages has a problem with this, however.
My site fails in the CI pipeline. Here’s the error message
The pertinent bit (I think?):
ERROR 2019/11/26 14:37:43 Transformation failed: TOCSS: failed to transform "main_parsed.scss" (text/x-scss): this feature is not available in your current Hugo version, see https://goo.gl/YMrWcn for more information
But is the problem my Hugo version, or is it the version used by GitLab pages? Any help would be appreciated.
You could download the extended version of hugo in your CI script. I’m not familiar with GitLab Pages specifically but I’m guessing it’s possible. Steps would be something like:
download hugo extended tarball from github releases
un tar it
move it somewhere already on your PATH like /usr/local/bin
Thanks–this sounds right. In the config file, I set publishDir = "public/". Now when I run hugo locally, it generates the resources in that folder.
However, I think I need to change the .gitlab-ci.yml file so that gitlab pages serves from my /public/ (html) folder. Currently I have this:
# All available Hugo versions are listed here: https://gitlab.com/pages/hugo/container_registry
image: registry.gitlab.com/pages/hugo:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
test:
script:
- hugo
except:
- master
pages:
script:
- hugo
artifacts:
paths:
- public
only:
- master
I think I need something different, though. Any idea?
I have it working–maybe not the most efficient way. I copy the contents of the “public” folder into a separate repository (in github actually) and it works fine. Inelegant but at least I can stop messing around. Thanks everyone.