Skip to content

Conversation

@GregHolmes
Copy link
Contributor

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 <script type="application/ld+json">

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 GregHolmes requested a review from a team November 14, 2025 13:55
@GregHolmes GregHolmes self-assigned this Nov 14, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 14, 2025

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.

@GregHolmes GregHolmes force-pushed the EDU-2122-Investigate-adding-JSON-LD-Schemas-to-the-docs branch from b023748 to f25cd82 Compare November 14, 2025 14:07
@kennethkalmer kennethkalmer added the review-app Create a Heroku review app label Nov 17, 2025
@ably-ci ably-ci temporarily deployed to ably-docs-edu-2122-inve-ipvinv November 17, 2025 14:58 Inactive
Copy link
Member

@kennethkalmer kennethkalmer left a comment

Choose a reason for hiding this comment

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

Nice one @GregHolmes, it does what it says on the tin. I ran several pages through the schema.org validator and they do check out. Do you need some additional checks/verification from @umair-ably as well on this?

@GregHolmes
Copy link
Contributor Author

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 GregHolmes added the Do not merge When the PR is in progress do not merge label Nov 18, 2025
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2122-inve-ipvinv November 19, 2025 09:39 Inactive
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-2122-inve-ipvinv November 20, 2025 15:31 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Do not merge When the PR is in progress do not merge review-app Create a Heroku review app

Development

Successfully merging this pull request may close these issues.

4 participants