Add automatic JSON-LD schema generation for docs
Description
Implements automatic JSON-LD schema generation for all MDX documentation pages to improve SEO and enable rich search results. Schema types are automatically inferred from URL patterns with manual override support.
Example of /docs/chat/connect:
<script type="application/ld+json" data-react-helmet="true">{"@context":"https://schema.org","@type":"TechArticle","headline":"Connections","description":"Manage the realtime connections to Ably.","url":"http://localhost:3000/docs/chat/connect","publisher":{"@type":"Organization","name":"Ably","url":"https://ably.com"},"author":{"@type":"Organization","name":"Ably","url":"https://ably.com"}}</script>
Features:
-
Automatic schema type detection based on URL patterns:
- /api/* → APIReference
- /guides/*, /quickstart → HowTo
- Default → TechArticle
-
Generated schema includes: @context, @type, headline, description, url, publisher, and author
-
Manual override via frontmatter (jsonld_type, jsonld_date_, jsonld_author_, jsonld_custom_*)
-
Support for custom Schema.org fields using jsonld_custom_* prefix
-
Renders in
as
Files added:
- src/utilities/json-ld.ts - Schema generation utilities
Files modified:
- src/components/Head.tsx - Added JSON-LD rendering support
- src/components/Layout/MDXWrapper.tsx - Integrated schema generation
- src/components/Layout/Layout.tsx - Extended Frontmatter type definitions
- src/pages/docs/chat/connect.mdx - Example implementation
Zero configuration required for most pages. Schema automatically generated from existing frontmatter (title, meta_description, meta_keywords).
[!IMPORTANT]
Review skipped
Auto reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.
✨ Finishing touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
EDU-2122-Investigate-adding-JSON-LD-Schemas-to-the-docs
[!TIP]
📝 Customizable high-level summaries are now available in beta!
You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
- Provide your own instructions using the
high_level_summary_instructionssetting.- Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
- Use
high_level_summary_in_walkthroughto move the summary from the description to the walkthrough section.Example instruction:
"Divide the high-level summary into five sections:
- 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
- 📓 References — List relevant issues, discussions, documentation, or related PRs.
- 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
- 📊 Contributor Summary — Include a Markdown table showing contributions:
| Contributor | Lines Added | Lines Removed | Files Changed |- ✔️ Additional Notes — Add any extra reviewer context. Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
Thanks @kennethkalmer , I had a call with @umair-ably and @FayeMcC77 yesterday. We're going to change it slightly as we're going to generate a bit more information on these schemas etc. I'll mark this PR as do not merge for the time being.
Thank you for the review!