-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
fix(v2): blog should parse frontMatter.date even when time is present #5232
Conversation
Signed-off-by: wener <wenermail@gmail.com>
upgrade from alpha to beta, cause build failed |
✔️ [V2] 🔨 Explore the source changes: 0c88816 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/6101306d165c150008d146a0 😎 Browse the preview: https://deploy-preview-5232--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5232--docusaurus-2.netlify.app/ |
✔️ [V2] 🔨 Explore the source changes: 9f71685 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61013103486c3000071a53ca 😎 Browse the preview: https://deploy-preview-5232--docusaurus-2.netlify.app |
Hi, I'm not sure this fix is needed. Can you please explain to me which frontmatter date string are you using exactly that is producing an error? I'd like to double-check that you are doing things right in the first place. The problem could also be that we don't log a good-enough error message to troubleshoot the issue. |
@slorber Hi, you can check this build log https://github.com/wenerme/wener/runs/3180667805#step:5:782 also this one https://github.com/wenerme/wener/runs/3180720595#step:5:782 I give up comment out all date in front matter, and try fix the error. This line cause the problem https://github.com/wenerme/wener/blame/master/story/2016/2016-08-06-tap-titans.md#L2 this used to works in alpha version |
I see thanks, This is because Docusaurus does not really support the "blog post time".
Accepting the time may be more complicated. Why do you need that time in the first place? Would it be good enough if we just displayed an error telling you to remove those useless times? That seems safer to me because otherwise, we give a false impression that the time could be important and used in practice. It would be hard to use a time on a site like Docusaurus because assets are built statically. The final HTML must contain the blog post date, it can't be adjusted on a per-user basis according to visitor's tz. |
@slorber It's about metadata, I'd like to know when I wrote the article, even it's useless to docusaurus. docusaurus can offload the tz problem to |
Agree we could silently allow to provide a date even if it's not used in practice. Also taking a look at the code I think it's Yaml that converts the frontmatter date of a certain pattern to a string already so it may not even apply the UTC tz when doing so. I think current system is not perfect and has some edge cases and your PR won't break it more, so going to merge this for now |
Motivation
(Write your motivation here.)
frontMatter date is string, cause build error
Have you read the Contributing Guidelines on pull requests?
(Write your answer here.)
yes
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)
the problem is obvious, cause error like this https://github.com/wenerme/wener/runs/3180667805#step:5:782
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.)