Skip to content

Use Permalink property for image URLs

Sarah German requested to merge 69-abs-img-urls-v2 into main

What does this MR do and why?

Second attempt at closing #69 (closed). 😄

Using the .Permalink property will work when our base URL includes a subdirectory. The previous implementation did not.

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. Run make view and find a page with images, like: http://localhost:1313/technical-writing-group/gitlab-docs-hugo/operations/metrics/#metric-details
  3. Run make view-prod and verify the image loads with this URL as well: http://localhost:1313/technical-writing-group/gitlab-docs-hugo/operations/metrics/#metric-details

In both cases, images should render and have absolute URL paths.

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.

Closes #69 (closed)

Merge request reports