feat: complete MDX migration, stabilize environment & verify via E2E tests

Former-commit-id: ec3e64156a2e182535cbdcf0d975cd54603a517d
This commit is contained in:
2026-05-03 18:46:41 +02:00
parent e57661a586
commit b13f628b55
131 changed files with 1388 additions and 25288 deletions

21
lib/mdx.ts Normal file
View File

@@ -0,0 +1,21 @@
import fs from 'fs';
import path from 'path';
import matter from 'gray-matter';
const CONTENT_DIR = path.join(process.cwd(), 'content');
export async function getMdxContent(locale: string, slug: string) {
const filePath = path.join(CONTENT_DIR, locale, `${slug}.mdx`);
if (!fs.existsSync(filePath)) {
return null;
}
const source = fs.readFileSync(filePath, 'utf8');
const { content, data } = matter(source);
return {
content,
frontmatter: data,
};
}