-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
misc(v2): change blog front matter to snake_case #1989
Conversation
@@ -1,3 +1,10 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file are just nits.
@@ -11,7 +18,7 @@ export function truncate(fileString: string, truncateMarker: RegExp | string) { | |||
} | |||
|
|||
// YYYY-MM-DD-{name}.mdx? | |||
// prefer named capture, but old node version do not support | |||
// prefer named capture, but old Node version does not support. | |||
const FILENAME_PATTERN = /^(\d{4}-\d{1,2}-\d{1,2})-?(.*?).mdx?$/; | |||
|
|||
function toUrl({date, link}: DateLink) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@endiliey why is there a hardcoded date 2019-01-01 here? On L53 as well o.o
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not me who put that. Iirc its hardcoded that way by some prevs contributor who added cjk support.
He wanted to make it clear that its yyyy-mm-dd and then take the length lol.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just substring(0,9) lol
Deploy preview for docusaurus-2 ready! Built with commit 79760c1 |
Deploy preview for docusaurus-preview ready! Built with commit 79760c1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just add the docs but dont merge. I will merge right before release. I can also freeze netlify prod build if needed
6b54868
to
85b5e1f
Compare
@endiliey done. Thanks for the tip |
Motivation
Standardize our front matter. Front matter should be snake_case 🐍. I'm preserving the camelCase for legacy reasons, so users using the camelCase will still work.
Also, I'm removing two following fields:
authorFBID
- This is really unnecessary and we don't need it. People should just provide the FB Graph API image URL if they wanted a FB profile pictureauthorTwitter
- This was never ported to D2, but is still in the template and examplesI'm not updating the docs and template yet because it should be done only after alpha.35 is published or else there will be a mismatch between the doc and latest version.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Blog loads.
Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)