1

The site works fine on my custom domain (e.g. https://www.example.com/), but in the generated sitemap.xml (and also in RSS feeds) the URLs still point to the GitLab Pages default URL (https://project-xxxxx.gitlab.io/).

My config.toml has the correct baseURL:

baseURL = "https://www.example.com/"

But the deployed sitemap still uses the GitLab domain.
What am I missing?

1 Answer 1

0

Check your .gitlab-ci.yml. GitLab’s Hugo template often includes this line:

script:
  - hugo --minify --baseURL "$CI_PAGES_URL"

That --baseURL flag overrides the value in your config.toml and forces Hugo to use the GitLab Pages domain.

To fix, remove --baseURL:

script:
  - hugo --minify
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.