Skip to content
Snippets Groups Projects
Commit faab6444 authored by Emanuele Aina's avatar Emanuele Aina
Browse files

Fix URLs on forked projects by setting baseURL

GitLab Pages only really handles a single branch for each project, so
forking is the best way to have the proposed pages be rendered and
published by Pages.

By setting `baseURL` from CI using `$CI_PAGES_URL` we can ensure that
links are set properly instead of always pointing at
https://www.apertis.org/ as that's quite confusing during reviews.

However, for the main project we don't want to use the default GitLab
pages address, but we want to have links using the official
https://www.apertis.org/ address: to the main project now sets
`$BASEURL` as a CI/CD variable to point at https://www.apertis.org/


while forked projects will use the default based on `$CI_PAGES_URL`.

Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
parent d6ca3c3f
No related branches found
No related tags found
1 merge request!71Fix URLs on forked projects by setting baseURL
Pipeline #148359 passed
......@@ -15,7 +15,10 @@ test-html:
image: registry.gitlab.com/pages/hugo:0.62.2
stage: generate-html
script:
- hugo
- DEFAULT_BASEURL=${CI_PAGES_URL##http:} # don't force stuff on plain HTTP when publishing on HTTPS
- BASEURL=${BASEURL:-$DEFAULT_BASEURL} # set BASEURL in the CI variables to override it
- echo "Using base URL '$BASEURL'"
- hugo -b "${BASEURL}"
artifacts:
paths:
- public
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment