-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(docs): implement great docs improvements inspired by leerob.com #2337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
## Summary Implements comprehensive documentation improvements following best practices from leerob.com/docs - the gold standard for modern documentation. ### Key Changes - Linkable headings with stable anchors and click-to-copy - Skip navigation link for accessibility - JSON-LD TechArticle schema for SEO - Typography improvements (65ch line length, generous spacing) - Polished callout components with semantic icons - Related pages component for cross-linking - MDX-to-Markdown converter for AI agents - Pure markdown API at /docs/*.mdx - Content negotiation via Accept header - Unified path validation with security protections ### New Components - heading-anchor.tsx, callout.tsx, related-pages.tsx - code-block.tsx, feedback.tsx, copy-button.tsx - code-tabs.tsx, ai-search.tsx - lib/mdx-to-markdown.ts, lib/path-validation.ts - proxy.ts (content negotiation) ### API Endpoints - /api/mdx-content/[...path] - Pure markdown for AI - /api/feedback - Page feedback collection 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| headline: page.data.title, | ||
| description: page.data.description || '', | ||
| url: `https://composio.dev${page.url}`, | ||
| image: getPageImage(page).url, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSON-LD image uses relative URL instead of absolute
Medium Severity
The JSON-LD structured data sets image to getPageImage(page).url, which returns a relative URL like /og/docs/quickstart/image.png. However, Schema.org JSON-LD requires absolute URLs for the image property for search engines to properly use it. Other URLs in the same object correctly use absolute URLs (e.g., url is set to https://composio.dev${page.url}). The image URL needs to be prefixed with the domain to produce valid structured data that Google and other search engines can consume.
| {/* Skip navigation for accessibility */} | ||
| <a href="#main-content" className="skip-nav"> | ||
| Skip to main content | ||
| </a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skip navigation link target missing on non-docs pages
Medium Severity
The skip navigation link (href="#main-content") is added to the root layout and appears on all pages, but the target element with id="main-content" is only added to the docs page. On other pages (home, changelog, reference, toolkits), the skip link points to a non-existent element. This causes the accessibility feature to silently fail for keyboard and screen reader users on most pages of the site.
Additional Locations (1)
- Fix Zod schema compatibility with fumadocs-mdx internal Zod v4 - Enable tableOfContent in DocsPage component - Add TOCFix client component for XL screen TOC display - Add CSS overrides for TOC sidebar positioning - Remove unnecessary zod dependency from source.config.ts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
| /* Mobile nav header styling */ | ||
| #nd-nav-mobile { | ||
| backdrop-filter: blur(12px); | ||
| background: rgba(var(--color-fd-background), 0.9); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid CSS rgba() syntax with hex color variable
Medium Severity
The CSS rgba(var(--color-fd-background), 0.9) is invalid syntax. The --color-fd-background variable contains a hex color value (#ffffff or #1a1815), but rgba() requires separate RGB numeric values as arguments, not a hex string. This will cause the browser to ignore the entire background declaration, so the mobile navigation header won't have the intended semi-transparent backdrop effect.
The fumadocs grid layout was not properly placing the TOC in the third column. Using fixed positioning ensures the TOC displays correctly in the top-right corner on XL screens (≥1280px). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
AI agents can now request pure markdown content via: - /docs/quickstart.md (in addition to .mdx) - /tool-router/overview.md - etc. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
The custom TOC positioning fixes (fixed positioning, CSS overrides) caused more issues than they solved - main content became invisible. Reverting to fumadocs default behavior which shows TOC at bottom. Removed: - components/toc-fix.tsx (DOM manipulation for fixed TOC) - TOC CSS overrides in global.css - TOCFix import from docs layout 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
The <main id="main-content"> wrapper was breaking fumadocs' grid layout, preventing the TOC from appearing in the right sidebar on XL screens. Replacing with React fragment allows DocsPage to integrate properly with DocsLayout's CSS grid and the layout: variant to work correctly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Summary
Implements comprehensive documentation improvements following best practices from leerob.com/docs - the gold standard for modern documentation.
What's Changed
Phase 1: Linkable Everything
Phase 2: Visual Polish
Phase 3: Cross-linking & Discoverability
Phase 4: Accessibility
prefers-reduced-motionPhase 5: AI-First Infrastructure
/docs/*.mdxAccept: text/markdownheaderNew Components
components/heading-anchor.tsxcomponents/callout.tsxcomponents/related-pages.tsxcomponents/code-block.tsxcomponents/feedback.tsxcomponents/copy-button.tsxcomponents/code-tabs.tsxcomponents/ai-search.tsxlib/mdx-to-markdown.tslib/path-validation.tsproxy.tsAPI Endpoints
GET /api/mdx-content/[...path]- Serves pure markdown for AI agentsPOST /api/feedback- Page feedback collectionGET /docs/*.mdx- Pure markdown via URL extensionGET /docs/* + Accept: text/markdown- Content negotiationTest Plan
curl <preview-url>/docs/quickstart.mdx🤖 Generated with Claude Code