Repository navigation
fix(flame): canonical URL for the docs index and og:image under a matching deploy path - #465
Conversation
…ching deploy path
- The docs index got the landing page's canonical and og:url
(`<baseURL>/`) whenever meta.basePath has a prefix, so search engines
treated it as a duplicate of the landing page, or, with
experimental.pages, of the project's own home page. buildSeoMeta() now
takes the page kind ("docs" by default, "landing" for the landing page)
and gives the docs index `<baseURL><basePath>/`.
- og:image lost the docs prefix when its first segment equals the
deployment path from meta.baseURL (basePath "/repo" under
https://acme.github.io/repo), so every page pointed at a missing image.
The deployment path is now dropped only when the author wrote it out and
what remains is still a docs path, and before re-basing onto the prefix.
An audit of 16 basePath x experimental.pages x baseURL builds on Bun and
Node found no other broken SEO tags or assets: stylesheets, scripts,
chunks, favicons, url() in CSS and search index URLs all resolve.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
ℹ️ No critical issues. One minor
og:imageedge case is noted inline.
Reviewed changes
Reviewed in senior mode because this touches the flame build/render pipeline. I checked the canonical URL split and the reordered og:image deployment-path handling, and traced every buildSeoMeta() caller in build.ts and build.impl.ts.
- Docs index canonical: the new
SeoPagekind gives the docs index (slug "") the URL<baseURL><prefix>/. Only the landing call passes"landing"and keeps<baseURL>/. The two builds call it the same way, and at a root deployment the two URLs are the same, as before. og:imagedeployment path: the host segment is now removed before re-basing, and only when what is left is still a docs path. This fixesbasePath: "/repo"under…/repo,basePath: "/docs"under…/docs, and multi-segment prefixes such as/repo/v2under…/repo.- Tests and changeset: there are new canonical cases, a 10-case
og:imagematrix, and a source-parity test across both builds (other tests in__tests__already read node sources the same way). There is also a patch changeset for@docubook/flame.
Overall: READY WITH MINOR FIXES.
Top priorities:
- Run the deployment-path strip only on paths the author wrote as root-relative (see the inline comment).
There are no other findings. I found no DRY, security, or cross-runtime parity problems. isDocsPath is imported straight from ./base-path, which is fine for this server-only module.
claude-opus-5-5 | 𝕏
Only strip the deployment path from an og:image the author wrote as a
root-relative path. The check ran on the synthesized `${prefix}/${image}`,
so a bare relative image could lose a segment: `docs/og.png` with
basePath "/repo" under https://acme.github.io/repo resolved to
`…/repo/repo/og.png` instead of `…/repo/repo/docs/og.png`, and
`repo/og.png` at a root deployment under `…/repo` resolved to
`…/repo/og.png`.
There was a problem hiding this comment.
✅ No new issues found. The prior
og:imagefinding is addressed cleanly.
Reviewed changes
Reviewed in senior mode (flame build/render pipeline): the one follow-up commit since the last review.
- Deployment-path strip scoped to authored paths:
resolveOgImage()now tests the authoredimageinstead of the synthesized${prefix}/${image}. Anyimagethat starts with${deploymentPath}/is root-relative, sopath === imageinside the branch, and bare relative images can no longer lose a segment. - Bare-relative matrix cases: added three cases to the matrix —
docs/og.pngunderbasePath: "/repo",repo/og.pngat a root deployment, andog.pngunder/docs. Together they pin the regression the prior thread described.
Verdict: READY. There are no open Pullfrog threads.
claude-opus-5-5 | 𝕏

Why
An audit of the build output for
meta.basePathandexperimental.pageslooked at the client bundle CSS and JS, assets such as the OG image and favicon, and the SEO metadata. It found two bugs in the metadata, both reproduced on Bun and Node. The bundles and assets themselves were fine.Changes
Docs index canonical. With a prefixed
meta.basePath,docs/index.mdxgot the landing page's canonical andog:url(<baseURL>/) instead of its own (<baseURL><basePath>/). Search engines then treated the docs index as a duplicate of the landing page, or, withexperimental.pages, of the project's own home page.buildSeoMeta()now takes the page kind,"docs"by default or"landing". Both builds pass"landing"for the landing page. At a root deployment the two URLs coincide, as before.og:imageunder a matching deployment path.resolveOgImage()dropped the deployment path from any image path that started with it, to undo an author who wrote out the host segment. When the first segment ofmeta.basePathequals that path (basePath: "/repo"underhttps://acme.github.io/repo), it cut off the docs prefix instead, and every page pointed at a missing image. The deployment path is now dropped only when what remains is still a docs path, or at a root deployment. It is dropped before re-basing onto the prefix, so/repo/docs/og.pngunderbasePath: "/handbook"also resolves to the handbook copy.basePath: "/docs"https://acme.dev/https://acme.dev/docs/…/repohttps://acme.github.io/repo/(the project's home)https://acme.github.io/repo/docs/og:image,basePath: "/repo"under…/repo…/repo/assets/images/og.png(missing, 8 pages)…/repo/repo/assets/images/og.png(exists)Patch changeset for
@docubook/flame.Verification
Build matrix. The template was built with
basePathset to/docs,/handbook/v2,""and/repo, withexperimental.pagesoff and on, and withbaseURLset tohttps://acme.devandhttps://acme.github.io/repo. That is 16 builds per runtime. An auditor checked every page:og:url, and pointing at the page itself;og:imageabsolute and mapped to an existing file;url()in the built CSS resolves (data URIs excluded);Before: 16 of 16 combinations had problems on Bun and on Node. After: 16 of 16 are clean on both.
Browser. Each dist was served under
/repo/like a GitHub Pages project site, for/docswith the flag on,""off,/repoon and/handbook/v2off. In Chromium, every page had no failed requests, errors or CSP violations, the stylesheet applied, Mermaid rendered, andog:imagereturned 200.vitest: 786 tests pass, including new cases for the docs index and landing canonicals and a 13-caseog:imagedeployment-path matrix.tsc,oxlint,prettierandtest:release-planare clean, and the pre-push hook passed.Review follow-up (ff1a6cf)
Pullfrog noted that the deployment-path strip ran on the synthesized
${prefix}/${image}, so a bare relative image could lose a segment. For example,docs/og.pngwithbasePath: "/repo"under…/reporesolved to…/repo/repo/og.png. The strip now checks the authoredimage, so only a root-relative path the author wrote is affected. Three bare-relative cases were added to the matrix. Two of them fail on the old condition and all pass now. The 16-build audit is still clean on Bun and Node.Not changed: extensionless canonical URLs
Canonical and
og:urlare written without.html(…/docs/guide/routing), while links and files use.html. On hosts without clean URLs, every non-index canonical 404s. This includes GitHub Pages, whichflame deploytargets; in the browser check above, the canonical of each non-index page returned 404 from the plain static server. Changing it affects every host, so it is left for a separate decision. The options:.html, which works everywhere but points the canonical at a 308 redirect on clean-URL hosts;meta.cleanUrls(defaulttrue), with GitHub Pages builds fromflame deployusingfalse.