Skip to content

Add shortcode to list the maintained versions

Achilleas Pipinellis requested to merge axil-supported-versions-shortcode into main

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:

How to set up and validate locally

  1. Configure a local GitLab Docs environment.

  2. Check out this branch.

  3. In gitlab-org/gitlab, edit doc/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:

  1. Run Hugo with the CI_COMMIT_REF_NAME set to main:

    CI_COMMIT_REF_NAME=main make view
  2. Visit http://localhost:1313/policy/maintenance/#maintained-versions

    It should render like:

    Screenshot_2025-06-10_at_09-31-30_GitLab_release_and_maintenance_policy_GitLab_Docs

For all other cases (fallback):

  1. Run Hugo:

    make view
  2. Visit http://localhost:1313/policy/maintenance/#maintained-versions

    It should render like:

    Screenshot_2025-06-10_at_09-38-17_GitLab_release_and_maintenance_policy_GitLab_Docs

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 Achilleas Pipinellis

Merge request reports

Loading