Add shortcode to list the maintained versions
What does this MR do and why?
After the discussion in gitlab-com/gl-infra/delivery#2860 (comment 2508839771), it seems we don't have anywhere listed the maintained versions.
This MR creates a shortcode that reads the current versions from https://gitlab.com/gitlab-org/technical-writing/docs-gitlab-com/-/blob/main/content/versions.json and creates an unordered list, ONLY for the latest (unreleased) version.
Complements the /help
fallback.
See gitlab-org/gitlab!191742 (comment 2525198371) for a detailed discussion where we decided to only show this information on the docs site, and only on the latest (unversioned) docs.
TL;DR:
- The maintained versions are only shown under https://docs.gitlab.com/policy/maintenance/#maintained-versions
- If you visit a versioned page like https://docs.gitlab.com/17.11/policy/maintenance/#maintained-versions we link to the latest docs https://docs.gitlab.com/policy/maintenance/#maintained-versions
- If you visit
/help
, we link to https://docs.gitlab.com/policy/maintenance/#maintained-versions
How to set up and validate locally
-
Configure a local GitLab Docs environment.
-
Check out this branch.
-
In
gitlab-org/gitlab
, editdoc/policy/maintenance.md
and add the following section:## Maintained versions The following versions are currently maintained: {{< maintained-versions >}}
From there one, there are two options. One that only shows the list when on the latest docs (unversioned), and the other in all other cases.
For the latest docs:
-
Run Hugo with the
CI_COMMIT_REF_NAME
set tomain
:CI_COMMIT_REF_NAME=main make view
-
Visit http://localhost:1313/policy/maintenance/#maintained-versions
It should render like:
For all other cases (fallback):
-
Run Hugo:
make view
-
Visit http://localhost:1313/policy/maintenance/#maintained-versions
It should render like:
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.