Add migration for SVG icons
What does this MR do and why?
- Refactors migrate.go to support multiple migrations: moves file handling to a separate file, allows for running individual migrations for testing
- Adds a migration script to convert GitLab SVG icons to Hugo shortcodes
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md and checkout this branch, migrate-icons
-
Pull down fresh docs, but don't run migrations yet: REMOVE_BEFORE_CLONE=true go run cmd/gldocs/main.go clone
(clone script is unchanged) -
Run just the new icon migration against the GitLab docs: go run cmd/gldocs/main.go migrate icons ../gitlab/doc
-
Look at the diff. Icons are now in the new format: git -C ../gitlab/doc diff
-
Pull down fresh docs again and run the end-to-end clone + migrate: REMOVE_BEFORE_CLONE=true make clone-docs-projects
-
Run make view
and visit a few pages with icons, such as:
Icons should display similarly to how they do on the Nanoc site.
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