-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: global Markdown config option & frontMatterParser field #5972
Conversation
I adopted a pretty inelegant solution to this problem by only checking for "apparent" front matter on partials. I don't know if we should pass in file paths (hard to implement) or just drop the warning for front matter in partials altogether |
✔️ [V2] 🔨 Explore the source changes: 4394434 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61cfd68ecd0d580007842432 😎 Browse the preview: https://deploy-preview-5972--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5972--docusaurus-2.netlify.app/ |
Size Change: +606 B (0%) Total Size: 670 kB
ℹ️ View Unchanged
|
Signed-off-by: Joshua Chen <sidachen2003@gmail.com>
Closing until #6370. That one would mean totally turning this over, so I'd rather implement that first. |
Motivation
Initial step to #4625! 🎉
Resolve #5568.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Unit tests: TODO
Dogfooded on website:
Caveats
The callback is called on every Markdown file, including partials. This leads to warnings about unused front matter if the hook injects extra front matter. We should find a way to: (a) call the custom callback which may do other useful stuff and (b) not trigger the warning if there was no front matter prior to the callback call.
Another possible solution I can think of is add another
fileMetadata
context value in addition toplugin
, which includescreateTime
,author
,fileName
, etc. This may be useful also for the use-case of #5691.