[SOLVED] Hugo on GitLab Pages showing 404 error

Dear friends,

I’ve follow the installation steps at:

using this as a starter theme:

(following the “snap” method which brings me to get Hugo v0.25.1 installed )

It perfectly works on my local Ubuntu machine, but I can’t make it works on GitLab…

This is the related repository:

But as soon as i point the browser to:

i get a 404 error page:
“The page you’re looking for could not be found. Make sure the address is correct and that the page hasn’t moved.”

What’s wrong with it ? Any advice on what i should check/change to make it work ?

Thanks a lot in advance for a little help


The link to your repo was broken, but it is available at https://gitlab.com/up4digital/up4digital_it.

Anyhow, your site isn’t generating an index page. Hence the 404. Try publishing the post, and see if that fixes it.

The site is being hosted correctly, you can see the feed at https://up4digital.gitlab.io/up4digital_it/index.xml.

Dear maiki,

thanks a lot for your reply… in fact I’ve now noticed that on the GitLab repository there is nothing inside the /themes folder (!?!)

That’s strange because the theme I’m using (https://themes.gohugo.io/blank/) is present on my local installation of Hugo, but it seems that it’s not hooked when i do git add+commit+push

Searching on other discussions I’ve read that a possible cause may be related to the fact that the theme has been included as git submodule:
$ git submodule add https://github.com/Vimux/blank.git themes/blank

Any further idea on how to arrange it ?

thank you


You can see in my .gitlab-ci.yml you see I have a before_script section, where I give the build process more directions.

You can read around for which commands you need to load submodules (I don’t use them often, so I don’t know them off hand), and add them to the before_script section. That should do it.

Dear maiki,

I finally got it working by adding a before_script section to .gitlab-ci.yml as you suggested, like this:

  - git submodule init
  - git submodule update --force

(as found on this page: https://gitlab.com/kaushalmodi/kaushalmodi.gitlab.io/blob/master/.gitlab-ci.yml)

thanks again for your precious help!


Yes, Even I could resolve the same issue i was facing by adding the

  • git submodule init - git submodule update --force

But i want to know that how this before scripts resolves the issue in detail so if any one can help me with this would help me understand hugo and gitlab pages a bit more