-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
feat(plugin-blog): multi-authors support + authors.yml global configuration #5396
Conversation
11be61e
to
6256e64
Compare
✔️ [V2] 🔨 Explore the source changes: 11be61e 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/611fc8d1f17e8000079a075d 😎 Browse the preview: https://deploy-preview-5396--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5396--docusaurus-2.netlify.app/ |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5396--docusaurus-2.netlify.app/ |
✔️ [V2] 🔨 Explore the source changes: 01fa677 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/612767f9c4b1ed0007e9a094 😎 Browse the preview: https://deploy-preview-5396--docusaurus-2.netlify.app |
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.
Looks like a nice start! Thanks
@@ -100,6 +103,60 @@ function formatBlogPostDate(locale: string, date: Date): string { | |||
} | |||
} | |||
|
|||
type AuthorMap = Record<string, Author>; | |||
|
|||
async function readAuthorListFile( |
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.
As we have similar code in the docs plugin, we could extract some utility function that could read from js/yaml in a generic way?
Like readConfigFile("blog/authors",schema)
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.
In fact the YAML parser should be able to parse JSON because YAML is a superset of JSON. Should I make that refactor here?
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.
yes discovered that recently 🤪
I'll do it and try to merge this PR asap.
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 not entirely true? https://stackoverflow.com/questions/21584985/what-valid-json-files-are-not-valid-yaml-1-1-files
I ended up not doing it because at least it works right now
packages/docusaurus-plugin-content-blog/src/pluginOptionSchema.ts
Outdated
Show resolved
Hide resolved
packages/docusaurus-theme-classic/src/theme/BlogPostItem/index.tsx
Outdated
Show resolved
Hide resolved
It would be cool if we can either deprecate Bootstrap theme or actually maintain it 😅 Really awkward to make type check pass while at runtime it would actually break |
411a07a
to
1795027
Compare
5c2bd41
to
95a0dde
Compare
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
6765fe3
to
c92dede
Compare
packages/docusaurus-theme-classic/src/theme/BlogPostAuthors/index.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
packages/docusaurus-theme-classic/src/theme/BlogPostAuthors/index.tsx
Outdated
Show resolved
Hide resolved
packages/docusaurus-theme-classic/src/theme/BlogPostAuthor/styles.module.css
Outdated
Show resolved
Hide resolved
Thank you for implementing this feature! It is really helpful for bilingual blog maintenance in https://apisix.apache.org/blog, where technical writers and translators need to get involved in the documents, and they deserve the credit. |
Motivation
Resolve #5363.
authors
frontmatter + recommend it overauthor _*
legacy frontmatter (much more flexible)authors.yml
fileauthors.yml
dataauthors.yml
file can be localizedauthors
frontmatterHave you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Unit tests
Dogfood:
Docs: