Add migration for version history
What does this MR do and why?
Migrates version history to the Hugo shortcode version.
Closes #11 (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 history ../gitlab/doc
-
View the diff: git -C ../gitlab diff
Expected result: History items (blockquotes, with list items, that contain specific keywords) are rewritten as Hugo shortcodes, like this:
Before:
> - Introduced in 15.0
> - Deprecated in 17.0
After:
{{< history >}}
- Introduced in 15.0
- Deprecated in 17.0
{{</ history >}}
- Multiple history items on consecutive lines should be grouped into a single
{{< history >}}
block - Blockquote markdown character (
>
) is dropped
We can also test the end-to-end build with the migration:
-
Run the full build process: REMOVE_BEFORE_CLONE=true make clone-docs-projects
(runs the initial clones + all migrations) -
Run the preview server: make view
-
Browse around the site and verify that the History
content matches its appearance on the existing site.
Example pages:
- Nanoc: https://docs.gitlab.com/ee/administration/settings/account_and_limit_settings.html#max-attachment-size / Hugo: http://localhost:1313/administration/settings/account_and_limit_settings/#max-attachment-size
- Nanoc: https://docs.gitlab.com/ee/user/ai_experiments/#explain-code-in-the-web-ui-with-code-explanation/ / Hugo: http://localhost:1313/user/ai_experiments/#explain-code-in-the-web-ui-with-code-explanation
- Nanoc: https://docs.gitlab.com/ee/user/application_security/dependency_list/ / Hugo: http://localhost:1313/user/application_security/dependency_list/
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