docs icon indicating copy to clipboard operation
docs copied to clipboard

Add automatic JSON-LD schema generation for docs

Open GregHolmes opened this issue 1 month ago • 2 comments

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).

GregHolmes avatar Nov 14 '25 13:11 GregHolmes

[!IMPORTANT]

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in 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_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions: | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ 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.

❤️ Share

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

coderabbitai[bot] avatar Nov 14 '25 13:11 coderabbitai[bot]

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!

GregHolmes avatar Nov 18 '25 09:11 GregHolmes