Skip to content

fix(site): point site.url at the real publish location (doc.owncloud.com) - #98

Merged
DeepDiver1975 merged 1 commit into
mainfrom
fix/site-url-publish-location
Aug 21, 2026
Merged

fix(site): point site.url at the real publish location (doc.owncloud.com)#98
DeepDiver1975 merged 1 commit into
mainfrom
fix/site-url-publish-location

Conversation

@DeepDiver1975

Copy link
Copy Markdown
Member

The bug

site.yml declared the prototype's personal-fork address as the site URL:

url: https://deepdiver1975.github.io/owncloud-docs-monorepo

…while the site is live on GitHub Pages at the custom domain doc.owncloud.com, served at the domain root (protected_domain_state: verified, certificate approved, HTTPS enforced, deployed from main). The comment directly above the key already said it "must match the real publish location" — it did not.

Antora derives canonical URLs, the sitemap and the navbar link from site.url, so this was not cosmetic — it was visible in production. All four confirmed against the live site before the fix:

Live before
Canonical, every page <link rel="canonical" href="https://deepdiver1975.github.io/owncloud-docs-monorepo/server/11.0/index.html">
sitemap.xml on doc.owncloud.com lists only deepdiver1975.github.io URLs
Navbar logo href="https://deepdiver1975.github.io/owncloud-docs-monorepo"
Pagefind index /owncloud-docs-monorepo/pagefind/pagefind.js404

The canonical tag is the serious one: every page of ownCloud's official documentation was telling search engines that a personal fork is the authoritative copy.

Site search was broken too

ui/supplemental/partials/header-content.hbs hardcoded the Pagefind bundle path with the old project-site subpath:

bundle-path="/owncloud-docs-monorepo/pagefind/"   ->  HTTP 404
/pagefind/pagefind.js                            ->  HTTP 200

The path must stay absolute (the components dynamic-import() pagefind.js relative to their own URL, so ./pagefind/ would double up and 404 on shallow pages) — but on a root-served custom domain the correct absolute path carries no repo prefix. /pagefind/ is also where the index sits under npm run serve, so the old value was wrong for local preview as well.

Verified against a real build

Not just inspected — npm run build was run and the generated output checked:

canonical      <link rel="canonical" href="https://doc.owncloud.com/server/11.0/index.html">
bundle-path    <pagefind-config bundle-path="/pagefind/">
navbar logo    href="https://doc.owncloud.com"
sitemap        <loc>https://doc.owncloud.com/sitemap-android.xml</loc>
  • /pagefind/ resolves: public/pagefind/pagefind.js exists.
  • grep -rl 'deepdiver1975\|owncloud-docs-monorepo' public/no matches; not one stale reference survives in the built site.
  • npm test17/17 pass, 0 skipped. With public/ built, the four tests that require generated output run instead of skipping.

Local preview is unaffected: npm run antora-local overrides site.url with --url http://localhost:8080.

Also in this PR

  • The comments in both files documented the now-retired "GitHub Pages PROJECT site served under a subpath" layout. They now describe the custom-domain setup and name the three things that read site.url (default.hbs Pagefind dedup, sitemap-cleanup.js, the navbar logo), so the next person changing the deploy target knows what moves with it.
  • One stale @param example in go-redirect.js's docblock.

Deliberately not touched

The /owncloud-docs-monorepo/... prefixes in test/go-redirect.test.js. resolveGoPhp is prefix-agnostic by design — it only rewrites the /server/<version>/ segment — so those are arbitrary fixtures that still pass, and keeping a prefixed case documents that property. Also left alone: package-lock.json's name field, which is an npm package name, not a URL.

🤖 Generated with Claude Code

…com)

`site.yml` still declared the prototype's personal-fork address as the site URL:

    url: https://deepdiver1975.github.io/owncloud-docs-monorepo

while the site is live on GitHub Pages at the custom domain doc.owncloud.com,
served at the domain ROOT (certificate approved, HTTPS enforced, deployed from
main). The comment right above the key already said it "must match the real
publish location" -- it did not, and because Antora derives canonical URLs, the
sitemap and the navbar link from it, the mismatch was visible in production:

  * every page declared a canonical URL on the personal fork, telling search
    engines that a fork is the authority for ownCloud's official docs:
    <link rel="canonical" href="https://deepdiver1975.github.io/owncloud-docs-monorepo/server/11.0/index.html">
  * sitemap.xml served from doc.owncloud.com advertised only off-domain
    deepdiver1975.github.io URLs, which crawlers discard
  * the navbar logo linked users off doc.owncloud.com to the fork

Search was broken for the same reason. `header-content.hbs` hardcoded the
Pagefind bundle path with the old project-site subpath:

    bundle-path="/owncloud-docs-monorepo/pagefind/"   -> HTTP 404
    /pagefind/pagefind.js                             -> HTTP 200

The bundle path must stay absolute (the components dynamic-import pagefind.js
relative to their own URL), but on a root-served custom domain the correct
absolute path has no repo prefix. `/pagefind/` is also where the index sits
under `npm run serve`, so the old value was wrong for local preview too.

Verified against a real build (`npm run build`): canonical, sitemap and logo
href now all read https://doc.owncloud.com, the emitted bundle-path is
/pagefind/ and resolves to public/pagefind/pagefind.js, and no reference to the
old address survives anywhere in public/. Full suite is 17/17 with public/
built -- the four tests that need generated output no longer skip.

`site.url` is still overridden for local preview by `npm run antora-local`
(--url http://localhost:8080), so previews are unaffected. The comments in both
files, which documented the now-retired project-site-under-a-subpath layout,
are corrected to describe the custom-domain setup.

Not touched: the `/owncloud-docs-monorepo/...` prefixes in
test/go-redirect.test.js. resolveGoPhp is deliberately prefix-agnostic -- it only
rewrites the /server/<version>/ segment -- so those are arbitrary fixtures that
still pass, and keeping a prefixed case documents that property.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975
DeepDiver1975 requested a review from a team as a code owner August 21, 2026 10:28
@DeepDiver1975
DeepDiver1975 merged commit 0a45607 into main Aug 21, 2026
2 checks passed
@DeepDiver1975
DeepDiver1975 deleted the fix/site-url-publish-location branch August 21, 2026 10:48
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