Hugo website deployment to vercel, issue with submodule

335 views Asked by At

I am trying to deploy a Hugo static website to vercel via gitlab and having issues with theme submodule installation. Locally it is installed via git submodule add https://github.com/dsrkafuu/hugo-theme-fuji.git themes/fuji and it works.

When doing the deployment to vercel, apparently the theme is not fetched.

What was tried:

  1. Deploying locally and pushing public directory with built htmls into the repo from where it was fetched by vercel, while pointing Output Dierctory and/or root directory to public (and all other combinations of these parameters).
  2. Using vercel-CLI to do the same.
  3. Creating a shell script to trigger it in the install step of deployment (npm vercel-install) in vercel following this, but I get Command "yarn vercel-install" exited with 128 or Command "npm vercel-install" exited with 1
  4. Cloning the theme repo into the right place via Install Command parameter manually.

Do you know how a submodule can be properly fetched in vercel deployment?

1

There are 1 answers

0
Holger On

I recently faced this problem and it turned out to be not with git submodules but the default hugo version inside vercel is too old.

You can specify Hugo version by using HUGO_VERSION environment variable and set it to a recent release.

Possible causes:

  • In a recent release, hugo changed the default configuration path from config.toml to hugo.toml, thus hugo inside vercel(default to v0.58.2) cannot recognize the config, and it won't know which theme you selected.