Closed chenjiahan closed 2 weeks ago
The parsing function of frontmatter uses gray-matter
and doesn't use mdx-rs
.
To achieve this feature, maybe you can view: https://github.com/web-infra-dev/rspress/blob/ec951a7a94ab6a3dd0185d9a3289b2f4536a7968/packages/shared/src/node-utils/loadFrontMatter.ts#L5-L9
Is there progress or timeline on this feature? Any additional input before I open PR for this?
No progress yet, feel free to send a PR for this 😄
At present, this PR#1145 only implements this feature in theme-default
, and further exploration is needed to achieve as vitepress
.
At present, this PR#1145 only implements this feature in
theme-default
, and further exploration is needed to achieve asvitepress
.
Yes ☹️ Probably plugging in the build step and injecting the headers there would be better. Couldn't find this place and that is why I implemented it in the default theme layout. Maybe help me find this place and I can move the implementation over to there?
The rendering page step when build is here. https://github.com/web-infra-dev/rspress/blob/d4432ac1108130f43ae928aafedff6c9fe6de669/packages/core/src/node/build.ts#L83-L89
Done with #1168
Thanks!
What problem does this feature solve?
Provide support for injecting extra head tags via front matter, like Vuepress and Vitepress:
What does the proposed API look like?