Skip to content

Commit 0a45607

Browse files
fix(site): point site.url at the real publish location (doc.owncloud.com) (#98)
`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. Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 3a7b0e1 commit 0a45607

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

‎site.yml‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
site:
22
title: Documentation for ownCloud (A Kiteworks Company)
3-
# Deploy target is a GitHub Pages PROJECT site served under a subpath.
4-
# This URL drives canonical links (used by the Pagefind dedup layout) and
5-
# absolute asset resolution -- it must match the real publish location.
6-
url: https://deepdiver1975.github.io/owncloud-docs-monorepo
3+
# Deploy target is GitHub Pages on the custom domain doc.owncloud.com, served
4+
# at the domain ROOT (no repo subpath). This URL drives canonical links (used
5+
# by the Pagefind dedup layout in ui/supplemental/layouts/default.hbs), the
6+
# sitemap written by antora-extensions/sitemap-cleanup.js, and the navbar logo
7+
# link -- it must match the real publish location. Local preview overrides it
8+
# via `npm run antora-local` (--url http://localhost:8080).
9+
url: https://doc.owncloud.com
710
# the site's landing page resides in the main content component
811
# but it MUST be named ROOT to get a component/version-less landing page.
912
# see: https://docs.antora.org/antora/latest/page/start-page/

‎ui/supplemental/js/go-redirect.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
* redirect a legacy `go.php?to=<key>` request to, or null when this is not a
114114
* go.php request (so callers leave the page untouched).
115115
*
116-
* @param {string} pathname e.g. "/owncloud-docs-monorepo/server/latest/go.php"
116+
* @param {string} pathname e.g. "/server/latest/go.php"
117117
* @param {string} search e.g. "?to=admin-sharing"
118118
* @returns {string|null} the redirect target, relative to the site, or null
119119
*/

‎ui/supplemental/partials/header-content.hbs‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
overlay (also via Ctrl/Cmd+K). bundle-path MUST be absolute (the
1111
components dynamic-import() pagefind.js relative to
1212
pagefind-component-ui.js's URL, so "./pagefind/" would double and
13-
404 on shallow pages). On a GitHub Pages PROJECT site the index is
14-
served under the repo subpath, so the absolute path includes it. --}}
15-
<pagefind-config bundle-path="/owncloud-docs-monorepo/pagefind/"></pagefind-config>
13+
404 on shallow pages). The site is served at the root of the custom
14+
domain doc.owncloud.com, so the index is at /pagefind/ -- which is
15+
also where it sits under `npm run serve`. A repo-subpath prefix
16+
here would 404 on both. --}}
17+
<pagefind-config bundle-path="/pagefind/"></pagefind-config>
1618
<pagefind-modal-trigger></pagefind-modal-trigger>
1719
<pagefind-modal reset-on-close></pagefind-modal>
1820
</div>

0 commit comments

Comments
 (0)