Skip to content

feat(landing): centralize SEO metadata generation#268

Merged
lentil32 merged 6 commits into
mainfrom
landing-seo-schema-integration
Jun 1, 2026
Merged

feat(landing): centralize SEO metadata generation#268
lentil32 merged 6 commits into
mainfrom
landing-seo-schema-integration

Conversation

@lentil32

@lentil32 lentil32 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

One-Line Summary

Centralizes landing SEO metadata generation so pages and docs emit consistent canonical links, social tags, and schema.org JSON-LD.

User-Facing Changes

  • Landing pages now render canonical, Open Graph, Twitter, robots, title, and JSON-LD entries through shared Astro SEO helpers.
  • The docs index keeps its SEO metadata and schema generated through Starlight route middleware instead of a large inline frontmatter head block.
  • Blog reading-time labels are generated from rendered Markdown content instead of stored manually in each blog post frontmatter.

Why This Changed

SEO metadata was split between the landing layout, docs frontmatter, and page-specific schema helpers, which made updates easy to duplicate or drift. Blog reading time also lived in post frontmatter, so content edits could leave stale "min read" labels unless authors remembered to update them by hand.

How It Changed

  • Added @onequery/astro-seo with typed metadata builders, Astro head components, JSON-LD normalization, and script-safe JSON-LD serialization.
  • Updated BaseLayout.astro to delegate shared SEO tags and structured data scripts to SeoHead.astro.
  • Added docs index SEO metadata and schema builders, then merged those entries into the Starlight docs index with route middleware that de-duplicates title, canonical, sitemap, meta, and JSON-LD entries.
  • Added a remarkReadingTime plugin using mdast-util-to-string and reading-time, then made blog collection loading read and validate the generated readTime from Astro render frontmatter.
  • Added coverage for JSON-LD escaping, SEO head entry generation, and docs index structured data.

Bug Fixes

  • Under structured data values containing script-breaking characters like </script>, raw JSON.stringify output could terminate the inline JSON-LD script early; the new serializer escapes those characters while preserving parsed JSON values.
  • Under blog content edits, manually stored readTime frontmatter could become stale; read time now comes from the rendered Markdown tree.

Extra Context / Decisions (Optional)

No README changes. No visual screenshots are included because the behavior is in document head metadata and generated structured data.

Verification

  • rtk bun run format
  • rtk bun lint --format json
  • rtk bunx turbo typecheck --json
  • rtk bunx turbo test --json
  • Pre-push hook also ran lint-full successfully during rtk git push -u origin landing-seo-schema-integration.

Video / Screenshot (Optional)

  • N/A

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
onequery-landing ee717d8 Commit Preview URL

Branch Preview URL
Jun 01 2026, 08:07 AM

@lentil32 lentil32 merged commit 327375c into main Jun 1, 2026
9 checks passed
@lentil32 lentil32 deleted the landing-seo-schema-integration branch June 1, 2026 08:11
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.

1 participant