Skip to content

feat: add /latest/ URL redirect to current stable version#5082

Merged
mmattel merged 3 commits intomasterfrom
feat/latest-version-redirect
Apr 16, 2026
Merged

feat: add /latest/ URL redirect to current stable version#5082
mmattel merged 3 commits intomasterfrom
feat/latest-version-redirect

Conversation

@DeepDiver1975
Copy link
Copy Markdown
Member

Summary

  • Adds urls.latest_version_segment: latest and urls.latest_version_segment_strategy: redirect:from to site.yml
  • Antora will now generate static HTML redirect files at /component/latest/** pointing to the current stable version (e.g. /desktop/latest//desktop/6.0/, /server/latest//server/10.16/, etc.)
  • Works for all components and all sub-pages, not just the index
  • Uses the already-configured --redirect-facility static flag — no build script changes needed

Notes

  • redirect:from keeps the versioned URL as canonical; /latest/ acts as an alias
  • Prerequisite: master branches in component repos should have prerelease: true in their antora.yml so Antora correctly identifies the highest stable version as "latest" — please verify before merging

Test plan

  • Build the site locally with npm run antora and confirm public/desktop/latest/ redirect files are generated
  • Verify public/desktop/latest/index.html contains a redirect to /desktop/6.0/
  • Check a sub-page, e.g. public/desktop/latest/faq/ also redirects correctly
  • Confirm component repos' master branches have prerelease: true in antora.yml

🤖 Generated with Claude Code

@DeepDiver1975 DeepDiver1975 requested a review from mmattel April 13, 2026 14:31
@DeepDiver1975 DeepDiver1975 marked this pull request as ready for review April 13, 2026 14:40
@DeepDiver1975 DeepDiver1975 marked this pull request as draft April 14, 2026 09:04
DeepDiver1975 and others added 3 commits April 16, 2026 10:04
Add Antora urls.latest_version_segment config so that
/desktop/latest/ (and all other components) redirect to
the current stable version (e.g. /desktop/6.0/).

Uses redirect:from strategy: canonical URLs remain versioned,
static redirect files are generated at /component/latest/**
by Antora's built-in --redirect-facility static.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mmattel mmattel force-pushed the feat/latest-version-redirect branch from 8e077b2 to 3aa3fc2 Compare April 16, 2026 13:14
@mmattel
Copy link
Copy Markdown
Contributor

mmattel commented Apr 16, 2026

Claude is more guessing than knowing and having a tested PR is anyways out of scope when AI creates PRs...

With commit: make it working and add related updates, the following fixes have been incorporated and fully tested:

  • latest_version_segment and latest_version_segment_strategy is now proven to work as added
    Additional and required comments have been incorporated, which help to understand their usage with GH Pages
  • The change is now fully tested and does the following for multi versioned components:
    • The highest version will get latest in the URL instead of the version number
      This has the positive side effect, that if one references via link, it will always be resolvable.
    • The real version number is still shown on the page and via the drop-down selector
    • Additionally, one can use the version number in the URL instead
    • Existing hard coded links from the outer world that used latest in the URL will be resolved again
  • Relevant build keys have been moved from package.json to site.yml settings
    This makes the parameters much easier to handle and if CLI overwriting is necessary better readble
  • The directory of the Antora cache has been updated
  • package.json has been cleaned up and updated

IMPORTANT I
To make this work as described, all content repos that have versions MUST have prerelease: true in the antora.yml file that is not a stable version !

IMPORTANT II
As fallout of this change, an additional PR must be created that fixes sitemap creation.

IMPORTANT III
All versioned content repos need an update how to create a version branch. This will be done independently so as not to block the build task.

@mmattel mmattel merged commit e824f7f into master Apr 16, 2026
2 checks passed
@mmattel mmattel deleted the feat/latest-version-redirect branch April 16, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants