Make linking README section work when exploring CI/CD components

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

Support deep links for CI/CD catalog README sections.

Steps to reproduce

  1. Go to https://gitlab.com/explore/catalog/guided-explorations/ci-components/kaniko
  2. Click on Readme tab
  3. Click on a section like Usage
  4. Make sure the location bar updated to contain the section like https://gitlab.com/explore/catalog/guided-explorations/ci-components/kaniko#usage
  5. Reload browser
  6. README should be shown (with Readme tab activated) and the section should be shown

Refs guided-explorations/ci-components/kaniko#8 (comment 2303517783)

Example Project

https://gitlab.com/explore/catalog/guided-explorations/ci-components/kaniko

What is the current bug behavior?

Deep links to CI/CD component's README (via Readme tab) section does not work. Components tab is shown instead.

What is the expected correct behavior?

Readme tab is active and the README section is shown/anchored.

Relevant logs and/or screenshots

Screenshot_from_2025-01-17_20-45-54

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by 🤖 GitLab Bot 🤖