-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
fix(blog): normalize inline authors socials #10424
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
Changes from 5 commits
f835217
e2c4322
b89513b
c7e9822
1e30108
58a350d
6451ac9
a689f96
7e7b6ad
e8ac33e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
|
|
||
| import _ from 'lodash'; | ||
| import {normalizeUrl} from '@docusaurus/utils'; | ||
| import {normalizeSocials} from './authorsSocials'; | ||
| import type { | ||
| Author, | ||
| AuthorsMap, | ||
|
|
@@ -84,7 +85,10 @@ function getFrontMatterAuthors(params: AuthorsParam): Author[] { | |
| // becoming a name and may end up unnoticed | ||
| return {key: authorInput}; | ||
| } | ||
| return authorInput; | ||
| return { | ||
| ...authorInput, | ||
| socials: normalizeSocials(authorInput.socials ?? {}), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here if author front matter has no social key, the result will be If the key was absent before normalization, we'd rather keep it absent after normalization (unless it's an explicit goal of the normalization to always have an object for empty (in which case the normalized type shouldn't allow null/undefined anymore)
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm +1 to make
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we plan render those differently. I also like to normalize to
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think neither of those would be a concern when there aren't thousands of authors (by which time the blog posts' metadata is a far bigger concern). |
||
| }; | ||
| } | ||
|
|
||
| return Array.isArray(frontMatter.authors) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.