1. Connect

2. Create a new project

Click New project → Import project → Repository by URL

NB: Do not use the default Hugo template: it generates a broken install, based on the old (and no longuer maintained) Beautifulhugo theme.

Luckily, you can use almost any other Hugo theme, as long as you provide a valid configuration in .gitlab-ci.yml.

I successfully used the theme Remix, it comes with a pre-configured file.

Configure Gitlab Pages

So the settings were:

When you are done, click on Create project at the bottom of the page.

3. Define the baseURL

Open config.toml:

Open a file in Gitlab

Click Edit

Edit a file in Gitlab

Set baseURL = 'https://YOURUSERNAME.itcouldbewor.se/'

Click Commit changes at the bottom

4. Done!

After a few seconds, your website should be available at https://YOURUSERNAME.itcouldbewor.se/

You can follow the build from the CI / CD menu:

The CI menu allows to follow the Gitlab Pages process

Note: You may need to hard refresh your browser with Ctrl+Shift+R

References

Further reading