Hugo job on Gitlab fails


I am using All inOne theme with Hugo. Repo:

Whenever I try to push to the repo the Gitlab job fails with the following log:

Cloning repository...
Cloning into '/builds/rootkea/'...
Checking out 6d8dc6f1 as master...
Skipping Git submodules setup
$ hugo
Building sites … Total in 36 ms
Error: Error building site: "/builds/rootkea/小白探索记1-基本设置与常用软件.md:45:5": failed to extract shortcode: template for shortcode "center" not found
ERROR: Job failed: exit code 255  

It complains about missing center shortcode but I can see center.html in themes/AllinOne/layouts/shortcodes/ What am I missing?

BTW, the build gets completed successfully on local machine. So I’m guessing it’s either a version issue or an incorrect Gitlab configuration.

Thank you!

Hi — since it builds locally but not in GitLab CI, my hunch is that it isn’t cloning your repo recursively, so your theme repo is not cloned, and this would explain the missing shortcode.

Checkout their docs on handling git submodules in CI:

Thanks for the link!
Adding following CI variable to .gitlab-ci.yml fixed the issue:


Now the site gets build successfully but doesn’t quite look like the one built locally. That is, it is missing css, images etc. Not sure why. Still looking into it.

Happy to hear it’s building in CI now

For this, check if the asset paths are relative or absolute

Oops! I used instead of in baseURL
Thank you for all your help! :slight_smile: