Skip to content
2025
  • Next.js
  • JSON-LD
  • Open Graph
  • Static Generation

Book SEO Architecture

Structured data and metadata as a first-class concern — every book page readable by search engines, social cards, and reading apps without extra effort.

A literary publisher's catalog is only as discoverable as its metadata. Book pages need to be indexable not just as generic web pages but as structured Book entities that search engines can parse, social platforms can preview, and reading apps can import. The challenge is authoring that metadata once per title — in the content layer — and having it flow automatically into every surface that needs it without manual Open Graph tags or hand-written JSON-LD.

Each Book object in the content layer carries all the metadata needed for every downstream SEO surface. A set of pure utility functions transforms Book → Next.js Metadata → Open Graph → Twitter Card → JSON-LD Book schema, called once per static page generation.

  • Content-first metadata: the Book type includes publishDate, author (for the Person schema), publisher (for the Organization schema), isbn, and description. No separate SEO config file — the content model is the SEO model.
  • generateStaticParams for full pre-rendering: every book slug generates a static HTML page at build time with its metadata embedded. No server-side rendering, no metadata fetching at request time.
  • JSON-LD injection via dangerouslySetInnerHTML: the structured data script tag is rendered inside the page component using Next.js's script injection pattern, not the Metadata API (which doesn't support JSON-LD directly). This gives full control over schema shape.
  • Canonical URL construction: a shared buildCanonicalUrl() utility derives canonical URLs from the base domain + slug, ensuring consistent canonicalization across the ryan and formaetrix domains.

The JSON-LD schema nests three schema.org types: Book (the primary entity), Person (for the author, with a sameAs URL linking to the author page), and Organization (for the publisher/imprint). This nesting is what allows search engines to associate a book with a named author entity rather than treating the author as just a string. The buildBookJsonLd() function is a pure TypeScript function — no hooks, no React — which makes it fully testable and reusable across SSG contexts.

Every book in the catalog is fully represented in search engine indexes, social media previews, and structured data graphs — authored once in the content layer with zero per-page SEO work.

  • 100% of book pages have Book schema, Open Graph, and Twitter Card
  • Zero per-page manual metadata authoring
  • Nested Person + Organization schemas for full entity graph
  • Static HTML output — no runtime metadata fetching