normalize-links script causes banner for outdated documentation to point to wrong latest release
Problem
In !619 (merged) we implemented a feature where a banner would show if you navigated to a version other than master and the latest stable.
This is currently broken though. If I visit https://docs.gitlab.com/13.1/ee/policy/maintenance.html, the banner shows up, but the link to the latest version is the one you're already on!
Fix
In https://gitlab.com/gitlab-org/gitlab-docs/-/blob/afe22ea888b592d25b87df8fcf34d283ff990356/layouts/default.html#L10, we define:
<div id="js-version-banner" <%= 'data-is-outdated' if show_version_banner? %> data-latest-version-url="<%= @item.identifier.without_ext + '.html' %>" data-archives-url="/archives/"></div>
The problem arises when we use normalize-links.sh
to prepend the version number to the versioned docs. The following line needs to be excluded from the script:
<div id=js-version-banner data-is-outdated data-latest-version-url=/link/to/page.html data-archives-url=/archives/></div>
TL;DR: Find a way to tell sed in normalize-links.sh
, to exclude the lines including data-latest-version-url
.