Skip to content

Add template partial for legacy path

Sarah German requested to merge legacy-path-metatag into main

What does this MR do and why?

  • Adds a template partial to find the legacy URL for the page. We'll need this for the Versions menu so that links to pre-Hugo versions will still work.
  • Refactors the edit-link shortcode so that we can share the page-source-project function between these two templates.

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.
  2. Visit a few pages from each source project, and verify:
  • The "Edit page" links in the footer still work
  • The gitlab-docs-legacy-path metatag contains the path to this page that works on the Nanoc site. Pages from the GitLab repo will have the /ee prefix here, and pages that end with .html extensions include these in the metatag.

Example pages from each project:

Project Example pages
GitLab http://localhost:1313/administration/reference_architectures, http://localhost:1313/install/cloud_providers/
charts http://localhost:1313/charts/, http://localhost:1313/charts/installation/upgrade
omnibus http://localhost:1313/omnibus/, http://localhost:1313/omnibus/settings/
operator http://localhost:1313/operator/, http://localhost:1313/operator/gitlab_upgrades/
gitlab-runner http://localhost:1313/runner/configuration/feature-flags/, http://localhost:1313/runner/commands/

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