Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue number:
Closes # n/a
Description of changes:
Currently, you can supply
latest
and a#
to get a context aware forward to the latest version.So, for example:
/en/os/latest#/install/quickstart/aws/host-containers/
would link to/en/os/1.19.x/install/quickstart/aws/host-containers/
and in the future/en/os/1.20.x/install/quickstart/aws/host-containers/
(and so on).However, this doesn't work if you need to deep link to an anchor (e.g. URLs with
#
)./en/os/latest#/install/quickstart/aws/host-containers/#prerequisites
forwards to/en/os/1.19.x/
(because it can't figure out a correct page and fails back to the most recent version).This commit adds additional logic to look for an additional
#
(the last one). If present, it uses what's before the last#
as the page and everything afterwards is appended to the end of the URL.Consequently:
/en/os/latest#/install/quickstart/aws/host-containers/#prerequisites
forwards to/en/os/1.19.x/install/quickstart/aws/host-containers/
and jumps the page to#prerequisites
Additionally,
/en/os/latest#/install/quickstart/aws/host-containers/
still forwards to/en/os/1.19.x/install/quickstart/aws/host-containers/
.If you supply it with multiple hashes the script still preserves the existing behaviour of falling back to the version directory (e.g.
/en/os/latest#/install/quickstart/aws/host-containers/#foo#prerequisites
will just go to/en/os/1.19.x/
).Terms of contribution:
By submitting this pull request, I confirm that my contribution is made under
the terms of the licenses outlined in the LICENSE-SUMMARY file.