We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d340c41 commit a2a19baCopy full SHA for a2a19ba
next.config.js
@@ -21,6 +21,20 @@ const nextConfig = {
21
},
22
async rewrites() {
23
return [
24
+ // Serve markdown when Accept header prefers text/markdown
25
+ // Useful for LLM agents - https://www.skeptrune.com/posts/use-the-accept-header-to-serve-markdown-instead-of-html-to-llms/
26
+ {
27
+ source: '/:path*',
28
+ has: [
29
30
+ type: 'header',
31
+ key: 'accept',
32
+ value: '(.*text/markdown.*)',
33
+ },
34
+ ],
35
+ destination: '/api/md/:path*',
36
37
+ // Explicit .md extension also serves markdown
38
{
39
source: '/:path*.md',
40
destination: '/api/md/:path*',
0 commit comments