Skip to content

docs: serve markdown to AI agents - #66

Merged
0ptaq0 merged 3 commits into
mainfrom
seo/agent-markdown
Oct 27, 2026
Merged

0ptaq0 merged 3 commits into
mainfrom
seo/agent-markdown

Conversation

@0ptaq0

@0ptaq0 0ptaq0 commented Oct 25, 2026

Copy link
Copy Markdown
Member

AI agents (ChatGPT, Claude, Perplexity, coding agents like Claude Code or Cursor) read markdown much better than rendered HTML. vitepress-plugin-llms already builds a markdown copy of every docs page (/page.md); this makes agents find it and get it without guessing.

Changes:

  • middleware.js (Vercel Routing Middleware): a page requested with Accept: text/markdown answers with its .md copy, the home page with llms.txt. Pages without a copy fall back to HTML. .md responses get a Link: rel="canonical" header pointing at the HTML page. Adds @vercel/functions (dev dependency, only used by the middleware).
  • VitePress config: every page links its markdown copy with <link rel="alternate" type="text/markdown"> (home page: llms.txt).
  • robots.txt: names the OpenAI, Anthropic and Perplexity crawlers next to * (same rules, everything allowed), adds Content-Signal: search=yes, ai-input=yes, ai-train=yes and points at llms.txt.

Checked on the Vercel preview: .md and Accept: text/markdown return markdown, browsers still get HTML, archived 3.1.0 pages (no markdown copy) fall back to HTML.

Verified with npm run docs:build: every rel="alternate" link points at a file in the build.

Try it on the preview or after deploy:

curl -H "Accept: text/markdown" https://dml.beyondthecloud.dev/dml/insert
curl -I https://dml.beyondthecloud.dev/dml/insert.md

@vercel

vercel Bot commented Oct 25, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
dml-lib Ready Ready Preview Oct 25, 2026 1:11pm UTC

Request Review

@github-actions

Copy link
Copy Markdown

🚀 Salesforce CI

✅ Deployment succeeded

✅ All tests passed

==========================================
     APEX TEST EXECUTION SUMMARY
==========================================

📊 Total Tests: 421
✅ Passed: 421
❌ Failed: 0
⏭️  Skipped: 0


🎉 All tests passed successfully!

📦 Workflow run, logs and artifacts


📊 Stats: 421 total | ✅ 421 passed | ❌ 0 failed
🤖 Automated comment by Salesforce CI

@codecov

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.42%. Comparing base (81a1a81) to head (fd130d5).

Additional details and impacted files
@@            Coverage Diff            @@
##             main      #66     +/-   ##
=========================================
  Coverage   97.42%   97.42%             
=========================================
  Files           2        1      -1     
  Lines        2330     1165   -1165     
=========================================
- Hits         2270     1135   -1135     
+ Misses         60       30     -30     
Flag Coverage Δ
Apex 97.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@0ptaq0
0ptaq0 merged commit 10bea6b into main Oct 27, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — fd130d52 Deployed Oct 25, 2026 by vercel[bot]
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.

1 participant