pluginMdx
pluginSsg に MDX・Markdown のファイルを対応させるプラグイン。
Table of Contents
How To Use
import { pluginMdx } from "minista"
export default {
plugins: [pluginMdx()],
}# heading
## heading2
paragraphOptions
pluginMdx({
remarkPlugins: [],
rehypePlugins: [],
})オプションは @mdx-js/rollup の Options と同一です。
remarkPlugins に remark-frontmatter または remark-mdx-frontmatter を用いると、デフォルトの設定を上書きできます。
Frontmatter
フロントマターは props として Layout や Page で使用可能です。draft を true にしたページは本番ビルドから除外されます。
---
title: Index
draft: false // true = Don't build the page
---
# {props.title}Component
MDX・Markdown のファイルはレイアウトテンプレートやページテンプレート内でコンポーネントとして使用できます。
import Content from "./index.mdx"
export default function () {
return <Content />
}