readMdx(options)Read raw MDX file content. This is useful when you need the raw content without parsing or rendering.
import { readMdx } from "@ariadocs/react";
const raw = await readMdx({
contentDir: "contents/docs",
slug: "getting-started",
});
options| Property | Type | Required | Description |
|---|---|---|---|
contentDir | string | Yes | Path to the content directory |
slug | string | Yes | File path without .mdx extension |
Returns a string containing the raw MDX content including frontmatter.
import { readMdx } from "@ariadocs/react";
export default async function RawContentPage() {
const raw = await readMdx({
contentDir: "contents/docs",
slug: "getting-started",
});
return (
<pre>
<code>{raw}</code>
</pre>
);
}