- Serve Markdown files for
.mdextensions (see #generating-markdown)- See how we do it at Rivet by copying
.mdxto the public folder in Next.js
- See how we do it at Rivet by copying
-
Log in to the Cloudflare Dashboard
Go to https://dash.cloudflare.com and select your site. -
Navigate to Snippets
- In the sidebar, click Rules > Snippets
- Click Create Snippet.
-
Add Your Snippet Code
- Name your snippet (e.g.,
docs_url_rewriter). - Paste in your code (see below)
- Name your snippet (e.g.,
-
Deploy the Snippet
-
Test Your Snippet
- Visit your site at
https://example.com/docs/.... Confirm this works as expected - Then call
curl "https://example.com/docs/..."to verify that you get served the markdown version
- Visit your site at