Skip to content

Add migration for SVG icons

Sarah German requested to merge migrate-icons into main

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.

  1. 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
  2. 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)
  3. Run just the new icon migration against the GitLab docs: go run cmd/gldocs/main.go migrate icons ../gitlab/doc
  4. Look at the diff. Icons are now in the new format: git -C ../gitlab/doc diff
  5. Pull down fresh docs again and run the end-to-end clone + migrate: REMOVE_BEFORE_CLONE=true make clone-docs-projects
  6. 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.

Edited by Sarah German

Merge request reports