Dev Roar Lab API Documentation - v1.6.0
    Preparing search index...
    • Reads all MDX files in a directory and returns their metadata, slugs, and content

      Parameters

      • dir: string

        Absolute path to directory containing MDX files

      • Optionallocale: string

        Optional locale code to filter files (e.g., 'ja', 'en')

      Returns { metadata: Metadata; slug: string; content: string }[]

      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'