Skip to content

Conversation

@nearestnabors
Copy link
Contributor

@nearestnabors nearestnabors commented Jan 17, 2026

Summary

  • Add <link rel="alternate" type="text/markdown"> to all page headers, pointing to the .md version of each page
  • Improve the MDX-to-markdown compilation so .md URLs return clean, readable markdown instead of raw MDX
  • Add fallback content for component-only pages (like the landing page) that shows the title, description, and link to the full interactive page

This enables LLM crawlers and training pipelines to discover and consume the markdown versions of our documentation, similar to what Vercel does with their docs.

Test plan

  • Visit any page and check the HTML source for <link rel="alternate" type="text/markdown" href="...">
  • Visit https://docs.arcade.dev/en/get-started/quickstarts/call-tool-agent.md - should return clean markdown with code blocks preserved
  • Visit https://docs.arcade.dev/en/home.md - should return fallback content with title/description and link to full page

🤖 Generated with Claude Code


Note

Enables clean, consumable markdown versions of docs and surfaces them to crawlers.

  • Adds app/api/markdown/[[...slug]]/route.ts endpoint that reads page .mdx, compiles to markdown (preserves frontmatter/code blocks, strips imports/exports/JSX, normalizes indentation), provides fallback content for component-only pages, and serves with text/markdown headers
  • Updates app/layout.tsx to inject <link rel="alternate" type="text/markdown"> pointing to https://docs.arcade.dev{pathname}.md for all non-root pages

Written by Cursor Bugbot for commit fd16de7. This will update automatically on new commits. Configure here.

nearestnabors and others added 3 commits January 17, 2026 01:04
- Add <link rel="alternate" type="text/markdown"> to page headers pointing to .md version
- Improve MDX-to-markdown compilation to produce clean markdown output
- Preserve code blocks and frontmatter while stripping JSX components

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Pages that only contain React components (like the landing page) now
return a helpful markdown response with the title, description, and
a link to the full interactive page.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@vercel
Copy link

vercel bot commented Jan 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Jan 17, 2026 10:03pm

Request Review

@evantahler
Copy link
Contributor

Screenshot 2026-01-16 at 5 18 00 PM On https://docs-git-feature-add-md-alternate-links-arcade-ai.vercel.app/en/get-started/quickstarts/call-tool-agent.md, there's something weird with the insertion of new codeblocks. The "```" I think needs to be at the start of the line

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

- Add dedent function to normalize indentation when extracting content from JSX components
- Add normalizeIndentation function to clean up stray whitespace while preserving meaningful markdown indentation (nested lists, blockquotes)
- Move list detection regex patterns to module top level for performance
- Ensures code block markers (```) start at column 0

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

The previous regex patterns `["']?([^"'\n]+)["']?` would truncate text
at the first apostrophe (e.g., "Arcade's" became "Arcade").

This fix:
- Uses separate patterns for double-quoted, single-quoted, and unquoted values
- Requires closing quotes to be at end of line to prevent apostrophes from
  being misinterpreted as closing delimiters
- Adds stripSurroundingQuotes helper for fallback cases

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

When x-pathname header is not set, pathname defaults to "/" which would
produce an invalid alternate link "https://docs.arcade.dev/.md".
Only render the alternate link when we have a real page path.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants