Absolute path to directory containing MDX files
Optionallocale: stringOptional locale code to filter files (e.g., 'ja', 'en')
Array of objects containing metadata, slug, and content for each MDX file
// Get all posts
getMDXData('/path/to/posts')
// [
// { metadata: {...}, slug: 'hello-world', content: '...' },
// { metadata: {...}, slug: 'second-post', content: '...' }
// ]
// Get only Japanese posts (extracts locale from filename)
getMDXData('/path/to/posts', 'ja')
// File 'hello.ja.mdx' becomes slug 'hello'
Reads all MDX files in a directory and returns their metadata, slugs, and content