Skip to content

feat(docs): add JSON-LD structured data for rich snippets#7484

Merged
aidankmcalister merged 4 commits intomainfrom
feat/json-ld-seo
Feb 12, 2026
Merged

feat(docs): add JSON-LD structured data for rich snippets#7484
aidankmcalister merged 4 commits intomainfrom
feat/json-ld-seo

Conversation

@aidankmcalister
Copy link
Member

@aidankmcalister aidankmcalister commented Feb 12, 2026

Added TechArticle and BreadcrumbList JSON-LD schemas to all documentation pages for Google rich snippet eligibility.

Changes:

  • Created structured-data.tsx component
  • Added schemas to v7 and v6 page templates
  • Enables rich snippets with article metadata and breadcrumb trails in search results

Test:

pnpm dev
# Visit http://localhost:3000/orm
# View source → search "application/ld+json"
# Should see 2 script tags with structured data

Summary by CodeRabbit

  • New Features
    • Added structured-data (JSON-LD) to docs pages: article metadata (title, description, author, publish/updated dates).
    • Added breadcrumb structured-data to represent hierarchical page navigation for richer search previews and improved indexing.

@vercel
Copy link

vercel bot commented Feb 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Feb 12, 2026 7:20pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

Walkthrough

Adds two new structured-data components, TechArticleSchema and BreadcrumbSchema, and injects them into two documentation page templates by rendering the schemas before the existing DocsPage. No public function signatures or exported types were changed.

Changes

Cohort / File(s) Summary
Documentation Page Templates
apps/docs/src/app/(docs)/(default)/[[...slug]]/page.tsx, apps/docs/src/app/(docs)/v6/[[...slug]]/page.tsx
Top-level JSX wrapped in a fragment and updated to render TechArticleSchema and BreadcrumbSchema (imported) before the existing DocsPage output. Props passed to DocsPage remain unchanged.
Structured Data Components
apps/docs/src/components/structured-data.tsx
New module exporting TechArticleSchema({ page }) and BreadcrumbSchema({ page }). Each builds a JSON-LD object (uses getBaseUrl, page metadata, page.slugs) and emits it via <script type="application/ld+json"> using dangerouslySetInnerHTML. No additional error handling or public API changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (1 file):

⚔️ apps/docs/src/app/layout.tsx (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding JSON-LD structured data components for rich snippets to the documentation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


No actionable comments were generated in the recent review. 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

🍈 Lychee Link Check Report

3660 links: ✅ 2736 OK | 🚫 0 errors | 🔀 258 redirects | 👻 664 excluded

✅ All links are working!


Full Statistics Table
Status Count
✅ Successful 2736
🔀 Redirected 258
👻 Excluded 664
🚫 Errors 0
⛔ Unsupported 2
⏳ Timeouts 0
❓ Unknown 0

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@apps/docs/src/components/structured-data.tsx`:
- Around line 78-83: The BreadcrumbSchema JSON-LD currently omits the same '<'
escaping used by TechArticleSchema, which can allow a slug like "</script>" to
break out of the JSON block; when producing the schema string for
dangerouslySetInnerHTML (the schema variable used in the return with
dangerouslySetInnerHTML), serialize and then escape '<' characters (e.g.,
replace(/</g, '\\u003c')) so BreadcrumbSchema matches TechArticleSchema's
escaping approach and apply this to any code paths that set schema before
rendering.
🧹 Nitpick comments (1)
apps/docs/src/components/structured-data.tsx (1)

62-70: Breadcrumb names use sentence case rather than title case.

The current transformation converts getting-started to "Getting started" (only first character capitalized). Breadcrumb schemas often use title case like "Getting Started". This is a stylistic choice, but title case tends to look more polished in rich snippets.

✨ Optional: Title case transformation
   page.slugs.forEach((slug, index) => {
     currentPath += `/${slug}`;
     breadcrumbItems.push({
       '@type': 'ListItem',
       position: index + 2,
-      name: slug.charAt(0).toUpperCase() + slug.slice(1).replace(/-/g, ' '),
+      name: slug
+        .split('-')
+        .map(word => word.charAt(0).toUpperCase() + word.slice(1))
+        .join(' '),
       item: `${baseUrl}${currentPath}`,
     });
   });

@aidankmcalister aidankmcalister merged commit bc58b2d into main Feb 12, 2026
8 of 10 checks passed
@aidankmcalister aidankmcalister deleted the feat/json-ld-seo branch February 12, 2026 19:26
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.

2 participants