Skip to content

fix(build): redirect the legacy /next/ URLs instead of 404ing - #112

Merged
dj4oC merged 1 commit into
mainfrom
fix/next-path-successor
Aug 31, 2026
Merged

fix(build): redirect the legacy /next/ URLs instead of 404ing#112
dj4oC merged 1 commit into
mainfrom
fix/next-path-successor

Conversation

@kw-tmueller

Copy link
Copy Markdown
Collaborator

Fixes #111.

Problem

On the pre-monorepo site, next was the version segment of each product's upstream master build. This repo publishes real version numbers only, so every inbound …/next/… link and every indexed next page dead-ended after the cutover.

The issue suggests mapping /next/*/dev/*, but no /dev/ path exists or should — the README's versioning rules deliberately forbid a moving source folder. The in-development line already lives at its real number marked prerelease: true, so that is what legacy next actually became.

What this does

antora-extensions/next-alias.js publishes a /<product>/next/ tree the same way latest-alias.js publishes latest: static meta-refresh stubs, noindex, canonical pointing at the real page, one hop to real content. Per component it targets:

/next/ URL redirects to why
/ocis/next/ /ocis/8.3/ prerelease dev line
/desktop/next/ /desktop/7.2/ prerelease dev line
/android/next/ /android/4.8/ prerelease dev line
/server/next/ /server/11.0/ no dev line — latest release
/ios-app/next/ /ios-app/12.7/ no dev line — latest release
/webui/next/… /webui/… versionless component
/next/ still 404 ROOT was versionless on the legacy site too

Per page, anything the dev line dropped falls back to the latest release, so a legacy URL never dead-ends when it has any live equivalent.

webui is included because docs-webui only ever had master (sync/manifest.yml), so all of its legacy URLs were /webui/next/**. The ROOT landing component is excluded: a /next/ tree there would invent URLs rather than rescue them.

639 stubs across the six components. Deep paths follow the dev line's own page-aliases moves — e.g. /ocis/next/deployment/services/s-list/proxy.html/ocis/8.3/admin/deployment/…, where ocis relocated that page.

Changes

  • antora-extensions/next-alias.js (new) — publishes the tree; target derived from the prerelease flag, so release rollover needs no bookkeeping.
  • antora-extensions/lib/alias-tree.js (new) — the catalog mirroring both alias extensions need, extracted from latest-alias.js, which keeps only what is specific to latest (−45 lines, no behavior change; its existing tests pass untouched).
  • ui/supplemental/js/go-redirect.jsnext joins PUBLISHED_VERSIONS: /server/next/go.php?to=<key> now resolves inside the tree, and that list is asserted against the published public/server/* segments in both directions.
  • test/next-alias.test.js (new) — build-output guards plus fake-catalog unit tests for the precedence rules the current content cannot exercise (prerelease wins; a dev-line rename beats an older real page; versionless no-double-add; ROOT skipped; latestPrerelease backstop).
  • README / agents.md / site.yml — record that latest and next are generated, never source folders, and that next tracks the prerelease flag.

Verification

npm run antora && npm test42 pass, 0 fail, 1 skip. The skip is honest: today every release page also exists in the prerelease line, so the release-only fallback has no live case to assert — the unit tests cover that path instead.

Also confirmed on the built site: no /next/ URL in any sitemap, and none in the Pagefind index (485 pages indexed, no redirect-stub fragments) — the same treatment /latest/ already gets.

Out of scope

The content has 35 broken xref:next@ocis:… / next@server:… cross-references (29 of them in content/main/modules/ROOT/pages/ocis_release_notes.adoc) that error on every build, including before this PR. They reference a next component version, which a redirect tree cannot supply — Antora resolves those xrefs before any redirect exists. They need editing to real version numbers; worth its own issue.

🤖 Generated with Claude Code

On the pre-monorepo site `next` was the version segment of each product's
upstream `master` build. This repo publishes real version numbers only, so
every inbound `…/next/…` link and every indexed `next` page dead-ended after
the cutover -- the SEO problem reported in #111.

The issue suggests mapping /next/* -> /dev/*, but no /dev/ path exists or
should: the in-development line already lives at its real number marked
`prerelease: true`. So `next` now resolves to that prerelease version per
component (ocis -> 8.3, desktop -> 7.2, android -> 4.8), falling back to the
latest release where a product has no dev line (server -> 11.0,
ios-app -> 12.7) and, per page, to the latest release for anything the dev
line dropped.

antora-extensions/next-alias.js publishes the tree the same way
latest-alias.js publishes `latest`: static meta-refresh stubs, noindex, one
hop to real content, kept out of the sitemap and the Pagefind index. The
catalog mirroring both extensions need moves to lib/alias-tree.js, so
latest-alias.js keeps only what is specific to `latest`.

The versionless webui is included -- docs-webui only ever had master, so all
of its legacy URLs were /webui/next/**. The ROOT landing component is not: it
was versionless on the legacy site too, so a /next/ tree there would invent
URLs rather than rescue them.

`next` also joins PUBLISHED_VERSIONS in go-redirect.js, both because
/server/next/go.php?to=<key> now resolves inside the tree and because the
list is asserted against the published public/server/* segments.

Nothing has to be maintained on release rollover: the target follows the
`prerelease` flag.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <169163068+ThomasMuellerKiteworks@users.noreply.github.com>
@kw-tmueller
kw-tmueller requested a review from a team as a code owner August 31, 2026 16:28

@dj4oC dj4oC left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dj4oC
dj4oC merged commit 283155e into main Aug 31, 2026
3 checks passed
@dj4oC
dj4oC deleted the fix/next-path-successor branch August 31, 2026 18:25
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.

/next/ path successor

2 participants