Project can't build a complete preview without `gitlab/doc` files
Description
While working on gitlab-org/gitlab-runner!5205 (merged), I noticed that some files are missing from the Review App.
After reproducing locally, it looks like Hugo (as currently configured) requires files from gitlab/doc to be available to build a complete preview for other projects.
This means a complete review app can't be generated for projects that contain documentation except for gitlab.
This seems to affect static builds (from a pipeline) and also live local previews.
Steps to reproduce
- Create a new directory.
- In the new directory, clone these projects:
https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugohttps://gitlab.com/gitlab-org/cloud-native/gitlab-operator
- Change into the
gitlab-docs-hugoand runscripts/migration/content-post-process.sh - Run
make setupand thenmake view. - Go to
http://localhost:1313/operator/and you'll get a404. This page should exist: https://new.docs.gitlab.com/operator/.
To prove that gitlab/doc files are required:
- Go back into the new directory.
- Remove
gitlab-operatordirectory and re-clonehttps://gitlab.com/gitlab-org/cloud-native/gitlab-operator. - Also clone:
https://gitlab.com/gitlab-org/gitlabinto the new directory. - Change into the
gitlab-docs-hugoand runmake clean. - Run
scripts/migration/content-post-process.shand then runmake view. - Go to
http://localhost:1313/operator/and you'll get the content you expect.
Something about how Hugo is building the site requires at least some of the files in gitlab/docs to be present.
Actual result
Building previews for documentation without gitlab/docs files results in missing files in the build result.
Expected result
Any project set up for published documentation should be able to have previews build on their own.