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.
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(blog): author header social icons #10222
base: main
Are you sure you want to change the base?
feat(blog): author header social icons #10222
Changes from 2 commits
27479a4
c3a8ad5
51a8e08
7c45cfc
a93f742
685b2fe
30022fc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Extract
AuthorSocialLink
component, icon should be received aschildren
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.
unknown keys such as
twitter
andgithub
(and other keys that are not predefined) are typed as unknown which triggers TS to yellType 'unknown' is not assignable to type 'ReactNode'
However
as string
might be an ugly solution, otherwise maybe update theProps
type intheme classic.d.ts
but which key should we define here ? (twitter?github? other random website?)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.
We shouldn't use unknown keys in the first place
The type should contain a new "socials" attribute and we should validate those socials for both authors.yml and inline authors front matter
We should cover the most common socials (github, twitter/x, LinkedIn, SO, IG, website...) and allow unknown props (
.unknown()
in schema,[key: string]: string
in type) in case users want to add extra social platformsThere 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.
I've changed the schema to allow a social object, however i'm not sure about the typing of unknown props if the user add a social website
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.
I'm not sure we should choose one or the other, but let's discuss and figure this out
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.
This remains the main thing we need to solve to unblock this PR.
Can you add many dogfood cases of blog posts with single/many authors, with/without socials? We need to see how it would look like.
It would be preferable to keep displaying the author description, but maybe we can't when there are too many authors? 🤷♂️
Any multi-author blog inspiration to take a look from?
This Next.js blog only shows basic author info: https://nextjs.org/blog/next-12-3