Repository navigation
feat(seo): share metadata and JSON-LD at parity with the old site - #282
Conversation
The head was two mechanisms: `usePageHead` set title/description/image from inside PageTemplate, and `Head: ContentHead` emitted the canonical and the hreflang cluster from the route. A template is shared with the embed routes and the live preview, so it is the wrong level for either. Each content route's `+data.ts` now builds a `SeoDocument` where the document is already in hand, and one renderer emits it — the same renderer `/map` reaches through `lib/atlas-head.tsx`, so the site has one head shape. `pages/+config.ts` declares `title` and `description` once for every route; a route with no document of its own falls back to the site's name and description in the locale of the URL. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVDpddapWkWg3qEMdV
Every content URL now serves the Open Graph and Twitter properties vike-react does not generate, and a JSON-LD @graph describing it: Organization and WebSite everywhere, WebPage and Article for a page, BreadcrumbList under the knowledge menu, ItemList for a content index, AudioObject for a meditation, VideoObject for a lecture. `schema-dts` types every node, so a property schema.org does not define is a compile error rather than markup a validator rejects after deploy. A page with no image of its own shares the old site's own preview.png, which 59 of 66 production pages need. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVDpddapWkWg3qEMdV
The WebSite node carried whichever description the page had, so a crawler read one article's summary as the whole site's. It now carries the site's own description, which is what the node claims. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVDpddapWkWg3qEMdV
Found by the review pass over the branch: - The JSON-LD carried the default share image as the page's own, so 59 of 66 pages would have claimed the site preview as their article picture. `og:image` keeps the default — a link with no preview is worse than a generic one — and the nodes now carry the document's own or nothing. - A lecture's poster skipped the share variant and the origin, so the `VideoObject` could name a relative URL where a meditation named an absolute one. - `og:locale` spelled `pt-BR`, which Open Graph reads as `pt_BR`. Only the separator changes: nothing upstream stores a territory for a bare `en`. - `twitter:*` rode `property=`, while vike-react emits `name="twitter:card"` for `/map`. One tag had two spellings on one site. `absoluteHref` and `isKnowledgePage` move the two derivations this branch would otherwise have copied into their existing owners, which also removes the hand-rolled pair in `EmbedButton`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVDpddapWkWg3qEMdV
sydevs-bot
left a comment
There was a problem hiding this comment.
1 question for the reviewer, one per thread.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
One SeoDocument per route, built where the content is, rendered once — the ticket's shape. Taking the head out of the shared templates is the right fix for the embed and live-preview hazard, and the cluster, og:locale:alternate and the sitemap now read one derivation. Each joined change removes a duplicate this branch would have created.
One ticket error worth recording: §2 says og:url follows "the canonical's host rule: isIndexableHost decides". The canonical has never been gated — isIndexableHost has one caller, server/sitemap-routes.ts:183. The ungated og:url matches existing behaviour, so that open question needs no change.
Findings
should-fix—lib/content-seo.ts:244: anItemListentry can publish a meditation's internal adminlabel.consider—lib/structured-data.ts:67: eight single-caller builders; the rule centralising them is written 12 times.consider—lib/content-seo.ts:335: the home page'sWebPage.namestill claimsHome Page.
What was checked
Read whole: content-seo.ts, structured-data.ts, head.tsx, head-settings.ts, site-identity.ts, atlas-head.tsx, the three +data.ts, content-index.ts, content-blocks.ts, urls.ts.
Ladder walked on every new piece. Held: site-identity.ts has two consumers and stops the footer and sameAs drifting; absoluteHref, isKnowledgePage, lecturePlaybackSeconds and contentIndexBlocks each fold an existing duplicate into its owner; schema-dts is types-only.
Verified: both new translation keys exist in translations.en.json; alternateLocales has no consumer left; og:title and og:description come from vike-react's settings, per OG_EMITTED_BY_CONFIG (atlas-head.tsx:31); preview.png is 1200×1200, a centred logo on white, so a 1.91:1 crop keeps it whole — manual step 2 is answered.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-design | c9ff7bb | Commit Preview URL Branch Preview URL |
Nov 20 2026, 06:30 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-web | c9ff7bb | Commit Preview URL Branch Preview URL |
Nov 20 2026, 06:30 PM |
`<title>` took the composed `We Meditate | <tagline>` form while `WebPage.name` kept `page.meta?.title || page.title`, which is `Home Page` in production today — the one string the home page must never serve. The two now read one answer. Confirmed against cloud.sydevelopers.com: `homePage.title` is `Home Page` and its `meta.title` is null, so the fallback fires on the live site. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXKVG7aMsmczcPujHL
Every builder spelled `...(x ? { k: x } : {})` for each optional field, so
the rule the module exists to hold was written twelve times instead of
once. `compact` now holds it, and each builder is a flat literal that hands
SahajCloud's `string | null` straight to the field it belongs to.
`Nullable<T>` is what makes that typecheck: the builders keep their
schema-dts return types, so a misspelled `@type` or an undefined property
is still a compile error. `organizationNode` and an `ItemList` entry keep
plain literals — neither has a field that can be absent.
The omission assertions move to `toStrictEqual`, because `toEqual` passes
on a key present and undefined, which is the one way `compact` could fail
without a red test.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXKVG7aMsmczcPujHL
|
Two findings adopted, one rebutted. Lean gate green — eslint, Adopted
Rebutted
Waiting on you: the 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Ardnived
left a comment
There was a problem hiding this comment.
Decided in the terminal on 2026-11-18: this PR is reworked, not merged as it stands. The shape stays — one metadata document built in each route's +data.ts, one renderer, nothing set from a shared template, nothing under a live preview or on a non-indexable host. What changes is how the document is generated, and how much it says.
1. Generate it with Unhead, on the server only — after a spike
Use unhead and @unhead/schema-org (both 3.4.3) as a generator behind data.seo, never as component hooks: a component-level head hook is exactly what this repo forbids, because the templates are shared with the embed routes and the live preview.
Facts already checked, so they need no re-deriving:
- vike-react
0.6.32(installed) hasheadHtmlEnd,headHtmlBeginandonAfterRenderHtml. That is the injection point for a rendered head string. - Unhead v3, from its docs:
createHeadfromunhead/server, one instance per request; the instance is passed explicitly —useHead(head, …),useSeoMeta(head, …),useSchemaOrg(head, nodes, { tagPosition: 'head' })(its default isbodyClose); the schema plugin isUnheadSchemaOrg({ host });head.render()returns{ headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs }.@unhead/reactis not needed. - Traps: the server head inserts
<meta charset>, the viewport meta and<html lang="en">by default, and vike-react already writes<title>, the description andlang— nothing may be emitted twice.TemplateParamsPluginis opt-in in v3; without it%siteNameprints literally. Packages are ESM-only. The schema helpers do not check Google's required fields, so the guard and smoke specs here stay and grow. - Not documented anywhere: Vike, and Cloudflare Workers. Hence the spike.
The spike, first commit: one route (/lectures/:id) generates its head through Unhead in the Worker build, injected through headHtmlEnd; the PR preview serves it with no duplicated tag and one @graph; the Worker bundle's size change is stated. If the spike fails on any of those, say so in the PR and build section 2 on the existing schema-dts builders instead — the enhancements are wanted either way.
AudioObject has no helper; a meditation stays a custom node, linked into the same graph.
2. Say more — all four groups are in scope
Linked nodes, complete fields
- Every node carries an
@id, and they link:Organization→WebSite→WebPage→ the page's main entity and itsBreadcrumbList; the page's primary image as anImageObject;inLanguageon every node, from the URL's locale. - A lecture's
VideoObjectcarries what Google requires for a video result:name,thumbnailUrl,uploadDate, plusdescription,durationandembedUrl(its embed route). Take the date from the lecture's ownmetadatawhen it holds one; never invent one. - An article carries
datePublished,dateModified,authorandpublisher. Open Graph gainsarticle:published_time,article:modified_timeandarticle:author. og:imagecarries width, height and alt;twitter:image:altmatches.- A
robotsmeta withmax-image-preview:largeon indexable content routes; the embed routes saynoindex.
Embeddable players
- The meditation and lecture pages advertise their embed:
<link rel="alternate" type="application/json+oembed">, a same-origin oEmbed JSON endpoint answering for those two URL shapes only, andtwitter:cardplayerwithog:videopointing at the embed route. A pasted link then shows the player in WordPress and in chat previews.
More page types
- A page whose content holds an accordion of questions emits
FAQPagewith oneQuestionper item (the class pages do). - The music library emits a
MusicPlaylistofMusicRecordings, with artist and duration where SahajCloud has them. /appemits aSoftwareApplication(MobileApplication) with both store links:https://apps.apple.com/us/app/we-meditate/id6465684494andhttps://play.google.com/store/apps/details?id=co.wemeditate.sahajaapp.- An article with an author emits a
Personwith the author's name, title, description and photo.
App and device tags
apple-itunes-appwith app id6465684494, on content routes only, never on an embed.- A web manifest, an apple-touch-icon and
theme-color. Mind the rule that nothing site-wide goes inpublic/, which the Ladle build also ships.
3. Still true
- No user-visible literal: every word comes from
wm-web-translations, SahajCloud content, or is a brand name. - A field is emitted only when SahajCloud returned it.
- Each new claim gets a guard assertion, and the smoke spec checks a lecture, a meditation, an article, a class page and
/appon the preview.
The /app page and the per-page share images are content, being published separately under #160; until /app exists its node cannot be verified on a preview.
|
Merged
Lean gate green: eslint 0 errors, 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
- Open Graph and Twitter travel as Unhead's `useSeoMeta` input instead of `[key, value]` tuples, so `isOpenGraphKey`, `imageMeta` and the hand-spelled player and image structured properties go. A player route now emits one `twitter:card` (`player`) rather than two. - The generator adds the tags every published URL carries: `robots`, `twitter:site` and `apple-itunes-app`. `robots` was derived twice, and `/map` now carries the other two as well. - `inLanguage` comes from the schema-org plugin's config, which also fills it on the hoisted `ImageObject`s. - FAQPage is dropped: Google shows FAQ results only for government and health sites. The breadcrumb is Home → page, because Google refuses a rung with no URL anywhere but last, and the menu heading had none. - `/oembed` is flattened to `server/oembed.ts` beside `oembed-routes.ts`, as `sitemap` is. `playerIframe` takes the size, and no longer `.replace()`s its own output. `thumbnail_width` is dropped: the spec requires its height beside it, and it held the player's width. `EMBEDDABLE_COLLECTIONS` is exported once, and `documentEmbedHref` is typed against it. - `app-identity.ts` folds into `site-identity.ts`, dropping the unused store URLs and the Play Store id. - The smoke head readers parse with jsdom instead of regexes, which is how the `data-hid` vacuous pass happened. The source-scan guard over `+data.ts` text goes; the declared-once guard stays. - `VideoObject.uploadDate` waits on sydevs/SahajCloud#1236. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ofix Three files conflicted, all against #282. `pages/+Head.tsx`: #282 adds the apple-touch-icon, the manifest link and `theme-color`. Its tags stand, written with their props sorted, so the new lines satisfy `perfectionist/sort-jsx-props` like the rest of the file. `lib/head.test.tsx`: #282 rewrote the file around `isSafeJsonLd`, `seoDocument` and `NoIndexHead`. This branch had only reformatted the two hreflang tests #282 deletes, and they call a `cluster` helper the rewrite removes, so they are dead either way. `lib/hreflang.test.ts` carries that coverage now. Main's side stands. `pages/[slug]/data.test.ts`: #282 adds `knowledgePages` to the settings fixture, which this branch does not touch. Main's side stands. No second mechanical commit follows: `pnpm lint` exits 0 on the merge as it stands, and the 91 files main brought in need no reformat. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWFmyi3iWXmttQv3au
The only conflict was the import block in server/entry.ts: this branch adds registerLegacyRedirects, main's #282 adds registerOEmbedRoutes. Both stay. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVjP8vYv9piKZ7dSWz
#282 landed the SEO head rewrite, which moved the head out of `Head: ContentHead` and into a `SeoDocument` built in `+data.ts`. Both conflicts are that rewrite meeting this branch's own work on the same two files. AGENTS.md: took main's bullet whole — it describes the architecture that now exists, and its wording already drops the "cannot disagree" claim this branch removed. Re-attached this branch's addition to it: the `[slug]` route's untranslated-page 302, and why the language dropdown therefore offers the unfiltered locale set. pages/[slug]/data.test.ts: one `request()` helper carrying both sides' fields. main needs `urlPathname` and `urlParsed.origin` for the head document; this branch needs `urlParsed.searchOriginal` for the query string the 302 keeps. Kept main's `knowledgePages` fixture and this branch's mutable `availableLocales`, its `{ active, scope, token }` preview fixture — the real `LivePreviewSession` shape — and both abort helpers, since `renders404` and `redirectOf` answer different questions. Lean gate green on the merge: 159 files, 1663 tests. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXihmLRsS3SkmMN8Gv
#282 rewrote `lib/head.tsx` onto Unhead: `ContentHead`, `ContentHeadTags` and `resolveOgImageUrl` are gone, and a content route now builds one `SeoDocument` in `+data.ts` through `lib/content-seo.ts`. This branch's only conflict was `lib/head.test.tsx`, which tested the removed `ContentHead`. Both sides' tests are kept. `lib/head.test.tsx` is main's file plus this branch's guard that neither new block imports a head helper, now naming `atlas-seo` rather than the removed `lib/atlas-head`. The canonical-invariance case moves to `lib/content-seo.test.ts`, beside the fixtures it needs, and pins the same property against its new owner: `seoRoute` takes the path from `urlPathname`, so the `?atlas=` and `?locale=` the widget writes reach neither the canonical nor the hreflang cluster. `ClassDirectory`'s docblock named `ContentHead` and `useAtlasHead`, neither of which exists after the merge. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVckmzeP9CM9mbf57b
`lib/document-routes.ts` took both sides: the list route's segment and matcher, and main's embed-route owner (#282). Neither touches the other. `AGENTS.md` took main's head rule, which replaced the one this branch was written against, and kept this branch's exception to it — a code route has no per-locale publish state, so `/meditations` advertises `availableLocales` whole where a content URL advertises the subset its document is published in. #282 also removed `ContentHead` and `usePageHead`, which only this branch's new route still imported: a head is now a `SeoDocument` its `+data.ts` builds, rendered by the one `headHtmlEnd` generator. So `/meditations` builds one through `meditationsIndexSeo`, beside the other content builders, and `tests/guards/content-head.test.tsx` gains its row. Its canonical and `hreflang` cluster are unchanged; the share card, `robots` and the `WebSite`/`Organization` graph are what the new mechanism adds. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWc3tPbXfxmwxUuts2
#282 replaced `lib/head.tsx`'s `ContentHead` with a `SeoDocument` each route builds in its `+data.ts`, so `publishedContentUrl` had nothing left to serve. Took main's file whole, and moved the share row onto `seo.canonical` from the route data — the same URL `seoHeadHtml` publishes as canonical, so the two still cannot disagree. Two behaviours survive the move rather than being rebuilt: - The window-origin fallback is gone. The canonical rides `data` to the browser already, so there is nothing to rebuild from a path-only `urlParsed`. - Live-preview suppression is now an explicit check in `+Page.tsx`. `+data.ts` builds `seo` under an open preview too, and `seoHeadHtml` drops the whole head there; a draft's URL 404s publicly, so it is not one to hand a sharer. `tests/a11y/page-types.test.tsx` now gives its two content targets the `seo` document the route hands a page, built by `pageSeo`. Without one the page reads `canonical` off `undefined`, and the article target would walk an axe run missing the share row. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZRp55YtiuL4Mk3wrn
The share row now reads its URL from `data.seo.canonical` (#282's shape), so a target whose route data carries no `seo` reads `canonical` off `undefined` and the render throws. `pageSeo` builds the fixture, so the article target walks an axe run with the row on it rather than without. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZRp55YtiuL4Mk3wrn
`layouts/LayoutChrome.tsx` was the only conflict. Both sides moved the same two lists, in opposite directions: this branch lifted `languages` and `socialLinks` into `useSiteNav`, so the footer and the phone menu read one list on both layouts, while #282 replaced the layout's hard-coded social array with `SOCIAL_PROFILES` in `lib/site-identity.ts` and kept `languages` local. Both intents hold: `useSiteNav` stays the one place the layouts read, and it now returns `SOCIAL_PROFILES` rather than a second copy of the same three profiles. `lib/content-seo.ts` claims that constant as the `Organization`'s `sameAs`, so a profile added there reaches the markup, the footer and the menu together. `SOCIAL_PROFILES` is `readonly`, which `Footer` already took, so `SiteNav.socialLinks` and `MobileMenu`'s prop widen to match. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjV1jbvBJgicqpdxHKQ
#282 listed every tag, module and consumer of the SEO head in a guide that loads in every session. Each module's own header holds that; the guide keeps the opt-in, the once-only generator and its guard test, the no-head-hook rule and the hreflang owner. Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
/mapcarried any before.data.seo, so the@graphis one set of linked nodes instead of a flat list.GET /oembedand a player card.theme-color, and the App Store banner./mappublishes through that same generator, so the site has one head mechanism rather than one plus an exception.documentEmbedHrefandlib/embed-player.tsfold the/embedsuffix and the iframe geometry that three surfaces were about to spell separately.Change outline
The head was two mechanisms at two levels. It is now one document, built where the content is, generated once per request on the server.
Flow — how a content route's head is built
pages/[slug]/+data.ts · meditations/[id]/(full) · lectures/[id]/(full) read the document from SahajCloud pageSeo / meditationSeo / lectureSeo lib/content-seo.ts title <name> | We Meditate # home: We Meditate | <tagline> canonical localeUrl(origin, locale, path) # also og:url and every node's url alternates buildAlternates(…) lib/hreflang.ts, unchanged meta og:* · twitter:* · robots · apple-itunes-app · article:* · og:image:* + links <link rel=alternate type=application/json+oembed> # media routes only - jsonLd serializeJsonLd([Organization, WebSite, …]) # schema-dts, hand-written + schema { site, inLanguage, nodes: SeoNode[] } # plain data, lib/seo-schema.ts → data.seo pages/+config.ts # once for the site, not per route - Head: ContentHead lib/head.tsx - SeoHeadTags(data.seo) # a React component, client bundle too + headHtmlEnd: seoHeadHtml lib/seo-head-html.ts + # vike-react's setting is global as well as cumulative: one declaration + # per route rendered the whole head once per declaration, on every page + createHead({ disableDefaults, plugins: [UnheadSchemaOrg({ host })] }) + disableDefaults # else a second charset, viewport and <html lang> + pushHead canonical · hreflang · meta · links + pushSchemaOrg Organization · WebSite · the route's own nodes + head.render().headTags # synchronous on the server + '' under a live preview, '' for a route that built no document + # so building the document in +data.ts is a route's whole opt-in title: contentTitle · description: contentDescription lib/head-settings.tsContract — one new public endpoint, and one new document
Behaviour — what the graph claims, and what it refuses to
Organization ──publisher── WebSite ──isPartOf── WebPage ──mainEntity── Audio/VideoObject │ ↑ @id minted here └── BreadcrumbList · ItemList · Question + every node carries @id and inLanguage + an image is hoisted to its own ImageObject, with width, height and caption pageSeo(page) + isArticle → Article: datePublished, dateModified, Person byline, Organization publisher + + article:published_time · article:modified_time · article:author + an accordion of question/answer items → @type ['WebPage','FAQPage'] + one Question each + a songs content-index block → MusicPlaylist of MusicRecording + byArtist ← the album's artist, its url gated by isSafeHttpUrl + duration ← the song's own, omitted where SahajCloud stores none - @type read off the slug: /about → AboutPage # Unhead's inference, pinned off - primaryImageOfPage ← the Organization logo # Unhead's fallback, pinned off og:image, where the upload reported its own geometry + og:image:width ← the variant's width + og:image:height ← the SOURCE's ratio at that width # a flexible variant sets width only + og:image:alt · twitter:image:alt ← the editor's alt text + nothing at all for a source narrower than the render # upscaling is unverified + the site default states its own 1200×630, because the asset is ours robots + max-image-preview:large on the real site + noindex on a preview Worker, a dev host, and both embed routesFiles — what each new module owns
lib/ head.tsx # SeoHead/SeoDocument, isOpenGraphKey, isSafeJsonLd, NoIndexHead. # `ContentHead` and the hand-rolled `SeoHeadTags`/`HreflangLinks` # renderer are both gone: one generator renders every head + atlas-seo.ts # /map's answer as the same SeoDocument. Replaces lib/atlas-head.tsx + seo-schema.ts # the @graph as plain, serializable descriptors + seo-head-html.ts # the generator: descriptors → head HTML. Server-only, vike's headHtmlEnd + embed-player.ts # the iframe and its geometry, which three surfaces must agree on + app-identity.ts # the store ids, the theme colour, the home-screen icon structured-data.ts # was eight schema-dts builders. Now isoDuration alone; the # serializer went with /map's component head, and so did schema-dts document-routes.ts # + documentEmbedHref(), the `/embed` suffix LectureTemplate hand-rolled content-blocks.ts # contentIndexBlocks generalized to contentBlocks(content, blockType) cloudflare-images.ts # + getVariantWidth(), so og:image:width is not a second literal public/images/metadata/ + share.png # 1200×630, the ratio every consumer crops to + icon.png # 1024×1024, the lotus mark alone. preview.png served both and fitted neither server/ + oembed/index.ts # resolveOEmbedTarget + buildOEmbedResponse. Reads nothing + oembed/routes.ts # the one read and the status codes + manifest.ts # buildWebManifest sitemap-routes.ts # + the two /manifest.webmanifest routes, beside robots.txt and sitemap.xmlContract — the page read gains two fields
Preview
Deployed: https://claude-feat-273-seo-parity-wemeditate-web.contact-c66.workers.dev. What to look at there:
/— the site-title form, the default share image asog:image,robotsnoindex(a preview is not the real site).curl -s <preview>/ | grep -c 'rel="canonical"'prints 1; onc221df7it printed 3/kundalini-bandhan(an article: it carries a tag) —og:typearticle,Articlewith both dates,article:*/kundalini(the knowledge menu lists it) —BreadcrumbList, and aWebPagewith noprimaryImageOfPage, because that page has none of its own/inspiration—ItemListof the cards the page server-rendered@type['WebPage','FAQPage']with oneQuestionper accordion item/meditations/142and/lectures/163—twitter:cardplayer,og:video, the oEmbed<link>,AudioObject/VideoObjectnamed as the page'smainEntity/oembed?url=<preview>/lectures/163— the player JSON.?url=https://evil.test/answers 404/map— one canonical, one@graph, both now from the same generator. The canonical is the atlas document's ownwebUrl, which is awemeditate.comURL even on the preview, by design/fr/manifest.webmanifest— the manifest, in French/meditations/142/embed— no canonical, noog:url, no JSON-LD, androbotsnoindexThe Ladle preview builds (its trigger includes
lib/*andpublic/*) but shows nothing of this change.Test results
.claude/skills/pr-prep/check.sh— eslint 0 errors,tsc --noEmitclean, 1572 testslib/content-seo.test.ts64,lib/seo-head-html.test.ts25,server/oembed/index.test.ts21,tests/guards/content-head.test.tsx14,lib/atlas-seo.test.ts12,lib/head.test.tsx11,server/oembed/routes.test.ts8,pages/head.test.tsx7,lib/structured-data.test.ts7,server/manifest.test.ts4pnpm build. Worker bundle +103 KB raw, +27 KB gzipped on the server build (3180 → 3283 KB raw, 808 → 835 KB gzipped); the client build is unchanged at 2351 KB, which is the point of generating server-side. The/mapconversion moved its head out of the client bundle tooserver/and adds a public endpoint, so the sweep ran over the whole branch, and again over each push since. The latest sweep probed the new locale strip on/oembedwith a hostile corpus — a double prefix,%2Fand%66rescapes,//, a backslash, dot-segments, non-ASCII homoglyphs and__proto__— and every one is refused; the origin comparison still runs before anything else touches the URL, and the matchedidcannot escape the iframe's quotedsrc, because the WHATWG path encode set covers",<,>and space. An earlier sweep read Unhead's compiled sanitizer for the JSON-LD sink and rendered the real/mappath with a hostile atlas answer — a quote breakout inog:image, a breakout in a meta key, a"><script>hreflang and a<img onerror>inside the graph. jsdom parsed nine head elements, one script, no executable script and no injected node, and the graph round-tripped unchangedThe smoke lane is what proves the generator runs in the Worker: nothing in the unit lane executes a vike
headHtmlEndhook, and nothing but the preview routes/oembedahead of the page catch-all. Six new smoke specs cover that, the linked graph,/map, the manifest, and the tag-duplication check.Manual verification
Notes for reviewer
disableDefaultsdoes stop a second<title>, charset and viewport, and that is what the smoke spec counted. What no spec counted was the generated head itself: vike-react declaresheadHtmlEndglobal as well as cumulative, so the three route declarations each ran on every page, and the preview served three canonicals, threerobotsmetas and three@graphblocks on/, on/:slugand on both media routes. The declaration now lives inpages/+config.tsalone, the source guard asserts there is exactly one, and the smoke spec counts the canonical,og:urland the JSON-LD block as well. Nothing else moved: the hook already returned''for a route carrying noseo.schema, which is why/mapand the embed routes were bare on that same preview while receiving all three calls.head.render()is synchronous on the server, so the hook matches vike-react'sHtmlInjectiontype with no cast.Smoke (web)was red onc221df7for a second reason, and that is why the above shipped unseen. Preview discovery read the firstworkers.devhost in Cloudflare's comment, which Cloudflare rewrites in place: between the push and that build finishing it still namedb60f0acand carriedb60f0ac's address. The lane measured the build before the one on trial — five specs failed on routesc221df7adds, and the two specs that would have counted the head passed over markup that predated it. Discovery now reads the comment'sLatest Commitcell and waits for this commit's own build.@typeon aWebPageis inferred from the slug, so/aboutwould publishAboutPage— the exact claim the ticket left out, because a slug is the editor's to change.primaryImageOfPagefalls back to the Organization logo.defineVideosubstitutes the literalNo description. All three are pinned off, and each has a test.VideoObject.uploadDateis still not emitted, and this is a data gap, not a choice.LectureMetadatacarriestitle,thumbnailUrl,hlsUrl,duration,subtitlesandlastSyncedAt— no publish date.lastSyncedAtis when we read the lecture. The lecture document's owncreatedAtis when it was created here, not when the talk was given, so neither is the date Google asks for. It needs an upstream field insydevs/SahajCloudfirst; the criterion is on the ticket and I have not ticked it.og:image:heightis derived, and omitted where it cannot be. A Cloudflare flexible variant constrains the width alone, so the height is the source's ratio at that width. Whetherwidth=1024upscales a narrower source is unverified, so a source under the variant width states no geometry at all rather than one of two possible answers.SoftwareApplicationfor/app. It stays blocked —/appdoes not exist yet, and Switch wemeditate.com over to the new site #160 owns it, so its node cannot be verified on a preview. The criterion stays on feat(seo): share metadata and JSON-LD at parity with the old site #273. (defineSoftwareAppexists in the library, so that node is a helper call when/applands.)MusicPlaylistis built, and has no preview URL to be checked on. A songs content-index block already resolves to the tracksMusicLibraryplays, so the descriptors read that same list rather than taking a second read. No published page carries such a block today —/music,/songsand/meditation-musicall 404 on the preview — so a smoke spec would assert nothing. The three unit cases render the real generator instead. A recording carries noinLanguage: the page's locale is the language of the track's name, not of a recording that may be instrumental.schema-dtsandserializeJsonLdare both gone. The serializer's last caller was/map's component head, so converting that route left it with none, and the devDependency with no importer in any file. Both removed; say the word and they come back.robotsspelling fixed a latent bug. The renderer sent everything buttwitter:toproperty=, sorobotswould have shipped as apropertymeta, which no crawler reads.isOpenGraphKeyinverts it to the real rule.<andisSafeJsonLdwas the belt to that braces. The generated block no longer passes that guard, so the security sweep ran the realrenderSeoHeadwith a script-closing payload and an attribute-breaking payload planted in fourteen SahajCloud-authored fields: every quote came back as an entity and every<inside the script came back escaped. Unhead does it in two layers,sanitizeTagsInPlaceandtagToString.isSafeJsonLdstill gates the one remaining pre-serialized block,/map's./oembedreads a title in whatever locale the consumer's URL names, without theavailableLocalesfilter the page routes apply. It is published translation text either way, so it serves a language the site does not currently offer rather than anything private. Say if you want the filter.application/ld+json; Unhead's block carries adata-hidattribute after it, so every assertion over a generated graph would have passed vacuously.og:image:widthandog:image:heighttravelled with the page's own image, so the 59 of 66 pages that fall back to the site default published a bareog:image. The asset is in this repository, so its pixels are known: the card now states them, andshareImageanswers the whole image rather than a URL, which puts the geometry beside theog:imageit belongs to instead of in each caller's extra meta. The fallback still carries noog:image:alt— alt text is a visitor-facing string, and every one of those is SahajCloud's, so that needs an upstream key first.preview.pngthread. One square file served both slots and fitted neither: a 1.91:1 consumer centre-cropped it, so the uncropped half was margin that read as an empty white card at feed size, and a home screen drew the wordmark at 48px.share.pngis 1200×630 — the shipped lockup recomposed at the ratio every consumer crops to, filling 58% of the frame.icon.pngis 1024×1024, the lotus mark alone, from the vectorLogoSvgdraws; its ink spans 70% of the canvas, inside the maskable safe zone, so the manifest declaresany maskablefrom one file. Both are recompositions of the existing brand asset, not new artwork — a designer replaces either file with no code change.tests/_helpers/png.tsreads each file's IHDR, so neither stated geometry can drift from its file.pageContextTmoved tolib/i18n.ts, besidegetT. It was the long-term answer you asked for on theuseTthread:hooks/now holds only hooks, andlib/head-settings.ts— the half of the head that ships to the browser — no longer reaches through a hook module for a plain function.server/oembed/is the first subfolder inserver/. The flat pair it replaces matchedsitemap.ts/sitemap-routes.ts, which is still flat. Say the word and the same grouping goes tositemapandatlas, or this one goes back.next-seois React components peer-depending onnext, one<script>per type and no linked graph;react-schemaorgisschema-dtsplus React, which mints no@id— the thing we removed;unschema-graphis not published to npm.@unhead/schema-orgis the only maintained library that assembles a linked@graphserver-side. What no library can own is the step before it: SahajCloud's document shapes are this site's, so the mapping onto schema.org nodes is the content model. Oflib/seo-head-html.ts's 381 lines, 140 are comments and 109 are that mapping. But one claim in it was simply wrong:defineMusicPlaylist,defineMusicRecordinganddefineMusicGroupall ship in3.4.3. They stay unused for a reason the comment now states —trackis typedNodeRelations<string>, so a nested recording needs a cast, though the resolvers render the nested form correctly (checked). What the hand-rolled node was really missing was its@id, which the rest of the graph carries and it did not. Fixed./zz/lectures/163as a second address./oembedis a Hono route where nothing stripped anything, so it had been relying on exactly that tolerance to resolve/fr/lectures/163. Both intents stand: the endpoint now strips the locale itself throughlocaleFromPath, which leaves an undefined code in place, so a media path under one is refused here too. The locale rides on the resolved target rather than being parsed a second time in the handler. The smoke lane had reached/oembedonly through a bare/lectures/:id, so no spec sent it a prefixed URL at all — the refusal half, which needs no particular language published, is now pinned there.meditationSeo/lectureSeowere proposed for merging into onemediaSeo— they differ in page type, name fallback, duration source and node type;contentTitle/contentDescriptionwere proposed for a shared factory — vike needs two exported names; the claim that vike-react'simagesetting can seepageContext.datais wrong, andtscsays so. AnItemListentry was called a leak of a meditation's internallabel—ContentCardalready prints that same string in an<h3>on the same indexable page.Detail
Why the document is still built in
+data.ts.titleanddescriptionare vike-react settings, read by a plain(pageContext) => stringwhere no hook may run, and re-applied on client-side navigation, which no head hook gets to do. So the only place both halves can read one answer ispageContext.data. The generator then reads the same document frompageContextinsideheadHtmlEnd, which is why the rendered string never ridesdataand never reaches the browser.Why the descriptors are plain data rather than Unhead's own inputs.
define*returns an object carrying a_resolver, and some resolvers hold functions. Putting those ondatawould mean serializing them. The descriptors (lib/seo-schema.ts) are the serializable half: a route says which nodes and what each claims, and the generator — server-only — knows how one is spelled. It is the same seamcontent-seo.ts/structured-data.tshad, with the spelling half moved behind the library.What
pushHeadandpushSchemaOrgare. Unhead'suseHeadanduseSchemaOrg, aliased. They take the head instance explicitly and are not React hooks, but@eslint-react/rules-of-hooksreads theuseprefix and errors — and keeping the prefix here would read as the component-level head hook this repo forbids, which is the opposite of what a server-only generator is.What replaced
schema-dts's compile-time check. The eight hand-written builders made a misspelled@typea compile error. Unhead'sdefine*helpers are typed against their own node types, which catches the same class of mistake at the same moment; what is lost is the type check on a plain node, and there are exactly two —AudioObject, because@unhead/schema-orgships nodefineAudio, andMusicPlaylist, whose helper exists but typestrackas a string or an@idreference.Why the FAQ link is Unhead's and not ours. The first attempt listed every
Questionin theWebPage'smainEntityas well as typing the pageFAQPage. Unhead writes that link itself once the type saysFAQPage, so each question appeared twice. The ids are still minted from the canonical (#question-1), so they are stable per URL rather than Unhead's positional#/schema/question/N.The
/oembedrefusal, and why it checks the origin. Theurlparameter is whatever a caller sends.resolveOEmbedTargetparses it, comparesparsed.originto the serving origin, and only then strips a locale and matches the path againstmatchDocumentRoutefor the two embeddable collections. Without the origin check, anyone could point a consumer at a media path on their own host and have us answer for their page. A locale-prefixed URL resolves, and the player it answers with keeps that locale; a prefix SahajCloud does not define is a path segment, so it is refused. An/embedURL does not resolve either: the embed route is the player, not a page with one.Why the manifest is a route.
public/is copied by the Vike build and the Ladle build alike, so amanifest.webmanifestthere would also claim to be the playground's. Being a route also lets it answer in the language of the URL, which a static file cannot — hence the locale-prefixed link in the head and both spellings registered. Its names come from the translations, so there is no literal in it.Measured, not assumed. Every library behaviour above was checked against the compiled source in
node_modules, or by rendering: thathead.render()is synchronous, thatdisableDefaultssuppresses charset/viewport/lang, thatdefineVideofillsdescription, thatdefineWebPagereads a subtype off the URL, that Unhead linksQuestionintoFAQPage.mainEntity, that thedata-hidattribute defeats the old smoke pattern, and that a nesteddefineMusicRecordingrenders without leaking its_resolver.Each new behaviour was watched failing. Removing
disableDefaults, therobotsline, the article dates, the player tags, the oEmbed origin check, the@typepin, the FAQ filter and the geometry guard each turn at least one test red; so does deleting theseo:line from a route's+data.ts, which the guard's source half catches./mapnow publishes through the same generator, which is the last thing that made "one head mechanism" untrue.lib/atlas-seo.tsadapts the endpoint's answer into theSeoDocumentevery other route builds;lib/atlas-head.tsx,SeoHeadTags,HreflangLinksand the cumulative-Headworkaround are gone with it. Its@graphstill arrives already serialized — upstream mints the ids — so the generator takes a pre-serialized block as well as descriptors, andisSafeJsonLdstill gates that one. Two claims moved with it:<title>and the description became vike-react's settings read off the document, and/mapgained therobotsmeta the rest of the site carries.Closes #273
🤖 Written by the sydevs autonomous loop — see what this is
https://claude.ai/code/session_01Mg9rjYYJDYBFAnWH6C4PjD