md + accept#3719
Open
gfletcher-cll wants to merge 16 commits intomainfrom
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
👋 gfletcher-cll, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
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.
Summary
This PR adds content negotiation support (
Accept: text/markdown) across the Developer Docs site, enabling all content-backed pages to be served as either HTML or Markdown from the same canonical URLs.It also introduces a consistent pattern for direct
.mdendpoints and consolidates Markdown generation through a shared helper.The result is a unified system where documentation pages can be consumed both by browsers and by tools (e.g., LLMs, scrapers, CLI workflows) without duplicating routes or content.
What’s included
1. Content negotiation (HTML ↔ Markdown)
All content-backed routes now:
AcceptheaderAccept: text/markdownis presentEach route also sets:
Vary: AcceptLink: </path.md>; rel="alternate"; type="text/markdown"2. Direct
.mdendpointsAdded explicit
.mdroutes for nested pages:Implemented via:
Special root endpoints added where needed:
/ccip.md/cre-templates.md3. Shared Markdown builder
All Markdown responses are generated through a single helper:
This ensures:
Bucket handling
Standard content buckets
Fully support negotiation +
.mdparity:vrfchainlink-functionschainlink-automationchainlink-localchainlink-nodesdata-feedsdata-streamsdatalinkresourcesoracle-platformaceany-apiarchitecture-overviewgetting-starteddta-technical-standardCCIP
Handled as a multi-route system:
/ccip→ root page (negotiation enabled)/ccip/*→ main docs (negotiation enabled)/ccip/tutorials/*→ tutorials (negotiation enabled)/ccip/directory/*→ HTML-only (data-driven UI)CRE
Handled as a hybrid route:
/cre→ root (negotiation enabled)/cre/<standalone>→ negotiation enabled/cre/<page-go|page-ts>→ negotiation enabled/cre/<page>→ HTML-only redirect shellCRE Templates
Special case due to content location:
/cre-templatessrc/content/cre/templatesHandled via explicit mapping:
Supports:
.mdparityHTML-only routes (intentionally excluded)
The following remain HTML-only because they are data-driven UI pages:
/ccip/directory/*These do not map to Markdown content and are out of scope for this PR.
Behavior examples
/vrf/vrftext/markdown/vrf.md/cre/pagetext/markdown/cre/page-tstext/markdown/ccip/directory/*Known limitations
/ccip/directory/*routes are HTML-only (data-driven, no Markdown source)/cre/<canonical>routes intentionally do not return Markdown (redirect behavior)cre-templatesuses a custom content path mapping (cre-templates → cre/templates)Testing
Validated across:
Each tested for:
.mdendpointImpact