I’m not even sure whether this is an Hugo issue, or whether it should be mentioned with GitLabs CI-CD.
The TLDR is that hugo is creating a lowercase folder to shove the index.html into, while the image is in a folder with an uppercase in it (the original “nameXY.md” also has those uppercases). This causes the html to be unable to reach the image and it does not show up.
I have created a pipeline with multiple stages, to act as an internal “Hugo preview” for changes on content files. When merged to main the changes will be pushed to another repo that is public. On both I’m working with GitLab pages.
- I pull hugo files from another repo, and filter out some pieces of content that are for internal documentation. I assign the hugo and content folder as artifacts.
- If not main branch, I adjust the URL in the config.toml for the internal preview. I hand over both folders as artifacts again (afaik previous artifacts are available for all following jobs, but I only read up on that later)
- Another stage where I filter out content files with specific frontmatter that says its internal. Handing over artifacts again (only main branch)
- deploy stage: (except main) basically just hugo -D and handing over the artifact public to the pages deploy job
- deployment for main is still wip
Until deploy stage it all looks good. I checked the different artifacts and they were still fine. But then I noticed that on the last artifacts, the ones I download are different to what I see when I browse them in GitLab. There are two folders in GitLab (probably also linux systems, I did not test that).
The folder with uppercase contains the image, the lowercase one contains the .html file, so the html cannot find the picture with the relative path that is used.
Downloaded artifacts of the last 2 stages.
Browsed artifact of the pages deploy stage.
So now the question is: is this a bug ?
(In my opinion Hugo should either create a folder that fits the filename exactly OR make sure that present folders are changed to all lowercase accordingly.)
If this is intended behaviour, do ppl have workarounds? I have thought about making all files and folders lowercase by default (with a CI-CD job) and also parsing all Markdown-files for filepaths and change them to lowercase, but I thought I’d ask first.