[FLUSS-2062][docs] Added Redirect for Latest Stable Version Docs #2085
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.
Purpose
Linked issue: close #2062
Per Issue #2062, this pull request adds redirect support for the latest stable version documentation (e.g.
docs/0.8/engine-flink/getting-started/→docs/engine-flink/getting-started/). This change will ensure that both implicit and explicit references to the latest stable version are resolved correctly, avoiding broken links.Brief change log
@docusaurus/plugin-client-redirectsplugin to support performing client-side redirects.createRedirectsredirect rule that applies only to the docs area, which will handle ensuring that the existing routes are evaluated and redirect routes are defined for those that are considered "unversioned" (e.g. "next", non-existant versions, etc.)createRedirectsfunction is not at all intuitive and I highly recommend reviewing over the documentation here to help make sense of things.Tests
These changes were tested locally and require an explicit
npm run buildandnpm run serveas redirect rules are only applied for production builds (so annpm run startwill not apply them). You can see an example of this running locally and successfully navigating through the available versions and redirecting routes that explicitly use the latest, stable version (0.8) below:fluss-redirecting-example.mov
API and Format
N/A
Documentation
N/A