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

  1. Create a new directory.
  2. In the new directory, clone these projects:
    • https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo
    • https://gitlab.com/gitlab-org/cloud-native/gitlab-operator
  3. Change into the gitlab-docs-hugo and run scripts/migration/content-post-process.sh
  4. Run make setup and then make view.
  5. Go to http://localhost:1313/operator/ and you'll get a 404. This page should exist: https://new.docs.gitlab.com/operator/.

To prove that gitlab/doc files are required:

  1. Go back into the new directory.
  2. Remove gitlab-operator directory and re-clone https://gitlab.com/gitlab-org/cloud-native/gitlab-operator.
  3. Also clone: https://gitlab.com/gitlab-org/gitlab into the new directory.
  4. Change into the gitlab-docs-hugo and run make clean.
  5. Run scripts/migration/content-post-process.sh and then run make view.
  6. 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.