upstream #1
@ -56,13 +56,11 @@ export async function getFileBySlug(type, slug) {
|
|||||||
|
|
||||||
let toc = []
|
let toc = []
|
||||||
|
|
||||||
// Parsing frontmatter here to pass it in as options to rehype plugin
|
const { code, frontmatter } = await bundleMDX({
|
||||||
const { data: frontmatter } = matter(source)
|
|
||||||
const { code } = await bundleMDX({
|
|
||||||
source,
|
source,
|
||||||
// mdx imports can be automatically source from the components directory
|
// mdx imports can be automatically source from the components directory
|
||||||
cwd: path.join(root, 'components'),
|
cwd: path.join(root, 'components'),
|
||||||
xdmOptions(options) {
|
xdmOptions(options, frontmatter) {
|
||||||
// this is the recommended way to add custom remark/rehype plugins:
|
// this is the recommended way to add custom remark/rehype plugins:
|
||||||
// The syntax might look weird, but it protects you in case we add/remove
|
// The syntax might look weird, but it protects you in case we add/remove
|
||||||
// plugins in the future.
|
// plugins in the future.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user