Skip to content

Allow site to publish either _index.md or index.md files as index.html

Evan Read requested to merge eread/allow-site-to-publish-_index_md-files into main

What does this MR do and why?

As part of gitlab-org/technical-writing-group/gitlab-docs-hugo#55 (closed), make the Docs site be able to publish either _index.md (Hugo style) or index.md files as index.html.

This would help both nanoc and Hugo to publish the same files.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.
  2. Check out this branch.
  3. Run make compile. The site should publish normally, including creating or updating index.html files.
  4. Modify your local checkouts of GitLab docs content so that all index.md files are renamed to _index.md. See https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/blob/bae8d80a4b25edd3ef8cfb050f94633945b1ff24/scripts/content-post-process.sh#L22 for inspiration.
  5. Run make compile. The site should publish normally, with files called _index.md published as index.html in the correct places.

Merge request acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Evan Read

Merge request reports