0

我已经使用 mdx 建立了一个 next.js 降价博客: https ://mdxjs.com/ 。

我希望能够在 mdx 文件本身的 frontmatter 部分中引用数据。像这样的东西:

// my-file.mdx
---
title: "My blog post title"

# {title} // should be replaced by the frontmatter title

现在,这行不通。它不会替换{title}为 frontmatter 中的标题(即。My blog post title)。我想知道是否有办法做到这一点,如果有,怎么做?

谢谢。

4

0 回答 0