feat: global Markdown config option & frontMatterParser field#5972
Closed
feat: global Markdown config option & frontMatterParser field#5972
Conversation
2 tasks
Collaborator
Author
|
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>
5 tasks
2 tasks
2 tasks
Collaborator
Author
|
Closing until #6370. That one would mean totally turning this over, so I'd rather implement that first. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
fileMetadatacontext value in addition toplugin, which includescreateTime,author,fileName, etc. This may be useful also for the use-case of #5691.