Add migration script for index.md links
What does this MR do and why?
Adds a script to update markdown links that reference index.md
pages.
For Hugo, they need to point to _index.md
instead. We already rename index files on build to _index.md
(from here); this MR just fixes links that point to them.
Relates to #62 (closed)
How to set up and validate locally
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md. -
Checkout this branch -
Fetch up-to-date content, but don't run any migrations: REMOVE_BEFORE_CLONE=true go run cmd/gldocs/main.go clone
-
Run this migration only: go run cmd/gldocs/main.go migrate indexLinks ../gitlab/doc
-
View the diff: git -C ../gitlab diff
Expected result: Relative markdown links to index.md
files now point to _index.md
, like this:
Before:
this is a sentence with an [index page](../index.md) link
After:
this is a sentence with an [index page](../_index.md) link
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.
-
I have evaluated the MR acceptance checklist for this merge request.
Edited by Sarah German