我已经用mdx设置好了一个使用next.js的markdown博客:https://mdxjs.com/。
我希望能够在mdx文件中引用frontmatter部分的数据。类似于这样的:
// my-file.mdx
---
title: "My blog post title"
# {title} // should be replaced by the frontmatter title
现在,这并不起作用。它没有使用正文中找到的标题(即My blog post title
)替换{title}
。我想知道是否有一种方法可以做到这一点,如果有,应该怎么做?
谢谢。