chassis: auto-derive canonical/og:url from the surface's production base#471
Merged
Conversation
An explicit canonical prop still wins; the bare apex placeholder (surface "root", no SurfaceUrls entry) stays canonical-less unless one is passed. Derivation uses urlsFor() (production) rather than the DEPLOY_ENV-switched URLS on purpose: every deployed copy of a page - staging path prefix or production subdomain - must declare the production URL as its canonical. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0176ZYTwoV8V4So9SBTizc5X
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.
Completes the canonical story from #463 in one chassis change instead of per-surface adoption: BaseLayout now derives the canonical (and
og:url) from the surface's production base inSurfaceUrls— deliberatelyurlsFor()rather than theDEPLOY_ENV-switchedURLS, because a canonical is a statement of authority, not navigation: the staging path-prefix copy of a page must declare the production URL, which is what stops the multi-doc-root duplicates competing in search.canonicalprop still winsroot, noSurfaceUrlsentry) stays canonical-less unless one is passed — the ambiguity that ruled out auto-derivation in chassis: canonical/Open Graph/twitter metadata + head slot in BaseLayout #463 is now a documented one-page exception instead of a sitewide opt-inVerification: build + unit + site a11y green; spot-checked emitted canonicals:
https://plays.kaihacks.ai/buechner/woyzeck/,https://kaihacks.ai/cvi/(nested main page reproducesURLS.cviexactly), subdomain roots for architecture/writing; apex placeholder emits none.🤖 Generated with Claude Code
https://claude.ai/code/session_0176ZYTwoV8V4So9SBTizc5X
Generated by Claude Code