MDX content support
Some MDX
content from ./src/pages/content.mdx
file.
Setup
- Install
@mdx-js/rollup
- Set
enforce: 'pre'
tomdx
plugin atvite.config.ts
// vite.config.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import generouted from '@generouted/react-router/plugin'
import mdx from '@mdx-js/rollup'
export default defineConfig({
plugins: [{ enforce: 'pre', ...mdx() }, , react(), generouted()],
resolve: { alias: { '@': '/src' } },
})
Adding pages
Add the home page by creating a new file src/pages/index.mdx
→ /
:
### Header
**Bold**, _italic_ and `inline-code`
Preview
Header
Bold, italic and inline-code
GFM
Autolink literals
, , and .Footnote
A note
Strikethrough
one or two tildes.
Table
a | b | c | d |
---|
Tasklist
- to do
- done
hello: frontmatter
Footnotes
-
Big note.