fix(build): redirect the legacy /next/ URLs instead of 404ing - #112
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #111.
Problem
On the pre-monorepo site,
nextwas the version segment of each product's upstreammasterbuild. This repo publishes real version numbers only, so every inbound…/next/…link and every indexednextpage 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 markedprerelease: true, so that is what legacynextactually became.What this does
antora-extensions/next-alias.jspublishes a/<product>/next/tree the same waylatest-alias.jspublisheslatest: static meta-refresh stubs,noindex, canonical pointing at the real page, one hop to real content. Per component it targets:/next/URL/ocis/next//ocis/8.3//desktop/next//desktop/7.2//android/next//android/4.8//server/next//server/11.0//ios-app/next//ios-app/12.7//webui/next/…/webui/…/next/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.
webuiis included becausedocs-webuionly ever hadmaster(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-aliasesmoves — 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 theprereleaseflag, so release rollover needs no bookkeeping.antora-extensions/lib/alias-tree.js(new) — the catalog mirroring both alias extensions need, extracted fromlatest-alias.js, which keeps only what is specific tolatest(−45 lines, no behavior change; its existing tests pass untouched).ui/supplemental/js/go-redirect.js—nextjoinsPUBLISHED_VERSIONS:/server/next/go.php?to=<key>now resolves inside the tree, and that list is asserted against the publishedpublic/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;latestPrereleasebackstop).agents.md/site.yml— record thatlatestandnextare generated, never source folders, and thatnexttracks theprereleaseflag.Verification
npm run antora && npm test→ 42 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 incontent/main/modules/ROOT/pages/ocis_release_notes.adoc) that error on every build, including before this PR. They reference anextcomponent 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