Add TechArticle JSON-LD structured data to doc pages#673
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds schema.org TechArticle JSON-LD structured data to Docusaurus doc pages by wrapping the DocItem/Layout theme component, and ensures lastUpdatedAt metadata is available for dateModified (while hiding the rendered “Last updated” UI).
Changes:
- Swizzles
DocItem/Layoutto inject a per-pageTechArticleJSON-LD<script>into<head>. - Enables
showLastUpdateTimeand hides the rendered “Last updated” element via global CSS. - Introduces optional
schema_type: tutorialfrontmatter on selected docs pages to emitlearningResourceType.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/theme/DocItem/Layout/index.tsx |
Adds a wrapper that builds and injects TechArticle JSON-LD using useDoc() metadata/frontmatter. |
src/css/custom.css |
Hides the rendered “Last updated” UI element while keeping metadata available. |
docusaurus.config.ts |
Enables showLastUpdateTime to populate metadata.lastUpdatedAt for JSON-LD. |
docs/toolhive/tutorials/mcp-optimizer.mdx |
Marks the page as tutorial via schema_type. |
docs/toolhive/tutorials/custom-registry.mdx |
Marks the page as tutorial via schema_type. |
docs/toolhive/guides-ui/quickstart.mdx |
Marks the page as tutorial via schema_type. |
docs/toolhive/guides-k8s/quickstart.mdx |
Marks the page as tutorial via schema_type. |
docs/toolhive/guides-cli/quickstart.mdx |
Marks the page as tutorial via schema_type. |
2 tasks
Swizzle DocItem/Layout to inject TechArticle schema.org JSON-LD into every documentation page, populated from frontmatter and Docusaurus metadata. Enable showLastUpdateTime for dateModified (hidden via CSS). Add schema_type frontmatter to tutorial and quickstart pages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address review feedback: use useDocusaurusContext to derive the page URL from siteConfig.url instead of hardcoding, and add an id attribute to the script tag for consistency with other JSON-LD blocks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Dan Barr <6922515+danbarr@users.noreply.github.com>
d064f34 to
8c38bc0
Compare
ChrisJBurns
approved these changes
Apr 7, 2026
Contributor
ChrisJBurns
left a comment
There was a problem hiding this comment.
LGTM! Reviewed with PR Briefing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds schema.org
TechArticleJSON-LD structured data to every documentation page to improve organic search discovery. The implementation swizzles theDocItem/Layoutcomponent to automatically inject structured data from each page's existing frontmatter and Docusaurus metadata.Changes:
DocItem/Layoutas a TypeScript wrapper that injectsTechArticleJSON-LD into<head>on every doc pageshowLastUpdateTimein the docs config to populatedateModifiedin the schema (the rendered "Last updated" text is hidden via CSS)schema_type: tutorialfrontmatter field; applied to quickstart and tutorial pages to signallearningResourceTypeThe JSON-LD is baked into the static HTML at build time, so crawlers see it without JavaScript execution.
Type of change
Submitter checklist
Content and formatting
🤖 Generated with Claude Code