Skip to content

Allow nanoc to process links to _index files

Evan Read requested to merge allow-nanoc-to-process-links-to-_index-files into main

What does this MR do and why?

For: gitlab-org/technical-writing-group/gitlab-docs-hugo#55, if we encounter links to _index.md, we need to change them because nanoc will serve index.html.

How to set up and validate locally

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.
  2. In a check out of gitlab connected to the GitLab Docs environment, in doc/index.md, update line 26 (https://gitlab.com/gitlab-org/gitlab/-/blob/4dfdb031c3f142bebb13fcb7f027f22408629446/doc/index.md#L26) so that the link to user/index.md is changed to user/_index.md.
  3. In the same check out of gitlab connected to the GitLab Docs environment, rename user/index.md to user/_index.md.
  4. Run make view and navigate to http://127.0.0.1:3000/ee/. Select the Use GitLab link (which points to http://127.0.0.1:3000/ee/user/_index.html) and get an error.
  5. Navigate to http://127.0.0.1:3000/ee/user/index.html and note the URL and that it worked.
  6. Check out this branch.
  7. Run make view and navigate to http://127.0.0.1:3000/ee/. Select the Use GitLab link (which now points to http://127.0.0.1:3000/ee/user/index.html) and you're taken to the right page (http://127.0.0.1:3000/ee/user/index.html).

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.

Merge request reports