Skip to content

Fix invalid schema.org JSON-LD on book detail pages#2932

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/fix-book-detail-jsonld-context
Draft

Fix invalid schema.org JSON-LD on book detail pages#2932
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/fix-book-detail-jsonld-context

Conversation

@posthog

@posthog posthog Bot commented Jul 11, 2026

Copy link
Copy Markdown

Summary

Book detail pages emitted invalid schema.org JSON-LD because setJsonLd keyed the structured-data context as @content instead of @context (src/app/pages/details/details.tsx). The injected application/ld+json block was therefore missing its required @context field, and a JSON-LD consumer reading r["@context"].toLowerCase() got undefined and threw a TypeError.

This renames the key to @context and, while there, corrects the nested entity keys from bare type to @type (Book, Organization) so the whole object is valid schema.org.

Why

The typo made structured data invalid on every book detail page, undercutting SEO rich-result eligibility across a class of high-traffic pages. (The runtime error itself was low-volume, but the correctness/SEO impact is broad.)


Created with PostHog Code from an inbox report.

The book detail page's structured-data builder keyed the schema.org
context as `@content` instead of `@context`, so every emitted
`application/ld+json` block was missing its required `@context` field.
Consumers reading `r["@context"].toLowerCase()` got `undefined` and
threw a TypeError.

Also corrects the nested entity keys from bare `type` to `@type`
(`Book`, `Organization`) so the markup is valid schema.org throughout.

Generated-By: PostHog Code
Task-Id: 47ed5f34-f836-4246-9518-b2034750d7e9
@mwvolo
mwvolo requested a review from RoyEJohnson July 16, 2026 00:25
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.

0 participants