Issue
The 'Download as PDF' links on the following pages are broken:
The security pages (toms, dpa, hipaa, nda) work correctly.
Root Cause
The PDF download API (/api/md-to-pdf) fetches markdown from URLs like https://langfuse.com/terms.md. The Next.js rewrite rule /:path*.md → /md-src/:path*.md maps this to /md-src/terms.md.
However, the marketing pages (terms, privacy, cookie-policy) are stored at content/marketing/*.mdx and get copied to public/md-src/marketing/*.md during build. So the actual file is at /md-src/marketing/terms.md, not /md-src/terms.md.
Fix
Add explicit rewrites for the marketing pages with PDF download links in next.config.mjs:
beforeFiles: [
// Marketing pages: /X.md → /md-src/marketing/X.md
// These pages live at content/marketing/*.mdx but are served at /*.md
{
source: "/support.md",
destination: "/md-src/marketing/support.md",
},
{
source: "/terms.md",
destination: "/md-src/marketing/terms.md",
},
{
source: "/privacy.md",
destination: "/md-src/marketing/privacy.md",
},
{
source: "/cookie-policy.md",
destination: "/md-src/marketing/cookie-policy.md",
},
// ... rest of rewrites
]
Related to: langfuse/langfuse#LFE-8951
Issue
The 'Download as PDF' links on the following pages are broken:
The security pages (toms, dpa, hipaa, nda) work correctly.
Root Cause
The PDF download API (
/api/md-to-pdf) fetches markdown from URLs likehttps://langfuse.com/terms.md. The Next.js rewrite rule/:path*.md→/md-src/:path*.mdmaps this to/md-src/terms.md.However, the marketing pages (terms, privacy, cookie-policy) are stored at
content/marketing/*.mdxand get copied topublic/md-src/marketing/*.mdduring build. So the actual file is at/md-src/marketing/terms.md, not/md-src/terms.md.Fix
Add explicit rewrites for the marketing pages with PDF download links in
next.config.mjs:Related to: langfuse/langfuse#LFE-8951