Hello everyone,
I am working on a documentation for my team. We are using Jenkins pipeline for one big framework and with each push to main we would like our documentation updated - we had this working till now with DocFX but we reached it’s limitation.
We moved to Hugo - using theme Doks (GitHub - h-enk/doks: Hugo theme helping you build modern documentation websites.).
In our pipeline we run npm install
and npm run build
. Then we publish html file as an artifact.
Currently I am in PR pipeline and the link for hosted documentation ends up as:
https://jenkins.domain.com//job/repository-name/job/pull-41922%252Fmerge/Docs/
When it’s finally in “production” on main branch it would be (haven’t tried, but DocFX is currently like this):
https://jenkins.domain.com//job/repository-name/job/main/Docs/
We got Hugo working and managed to automate building of the docs.
We are calling npm install
and npm run build
. Then we publish the html index file in the public
folder.
Problem is, there is no styling and the links are broken - my main suspect is setting the baseurl in config.toml. What do I change it to though? (Can I have url that works both for PR builds and main build using some wildcard?
Tried stuff like “/”, “job/repository-name/job/pull-41922%252Fmerge/Docs/”, “https://jenkins.domain.com//job/repository-name/job/pull-41922%252Fmerge/Docs/”.
All yield no result - I am hoping to first make it work locally but failing with that as well.
Locally only result works when I set baseurl to “/” and my styling and links work correctly using npm run start
- not when opening index.html when using npm run build
.
Am I perhaps approaching this wrong?