Deploy Your Material for MkDocs Site on GitLab Pages without unique domains
GitLab Pages is an excellent solution for hosting static websites. Since GitLab 17.41, unique domains are enabled by default for Pages deployments. These domains look like this:
https://website-762e3.gitlab.io/
2
However, if you prefer a cleaner URL structure, such as <username>.gitlab.io/<repository>
, you need to adjust your configuration.
Disable Unique Domains
To switch from a unique domain to the traditional URL structure, follow these steps:
- Locate Your Repository
- Go to Settings > Pages in the repository menu.
- In the Unique domain settings section, uncheck the box labeled Use unique domain.
- Click Save changes to apply the update.
Verify the New URL
After saving your changes, your documentation should be accessible at:
<username>.gitlab.io/<repository>
For more details, refer to the GitLab Pages documentation.
-
This blog was written when the current version was 17.8. Please note that settings or functions may have changed since then. ↩