mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-15 17:22:35 +02:00
feat(blog): author header social icons (#10222)
Co-authored-by: OzakIOne <OzakIOne@users.noreply.github.com> Co-authored-by: sebastien <lorber.sebastien@gmail.com> Co-authored-by: slorber <slorber@users.noreply.github.com>
This commit is contained in:
parent
8b877d27d4
commit
a6de0f2725
35 changed files with 1005 additions and 31 deletions
|
@ -43,6 +43,29 @@ yarn workspace v1.22.19image` is a collocated image path, this entry will be the
|
|||
authorsImageUrls: (string | undefined)[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Note we don't pre-define all possible platforms
|
||||
* Users can add their own custom platforms if needed
|
||||
*/
|
||||
export type SocialPlatformKey =
|
||||
| 'twitter'
|
||||
| 'github'
|
||||
| 'linkedin'
|
||||
| 'stackoverflow'
|
||||
| 'x';
|
||||
|
||||
/**
|
||||
* Social platforms of the author.
|
||||
* The record value is usually the fully qualified link of the social profile.
|
||||
* For pre-defined platforms, it's possible to pass a handle instead
|
||||
*/
|
||||
export type AuthorSocials = Partial<Record<SocialPlatformKey, string>> & {
|
||||
/**
|
||||
* Unknown keys are allowed: users can pass additional social platforms
|
||||
*/
|
||||
[customAuthorSocialPlatform: string]: string;
|
||||
};
|
||||
|
||||
export type Author = {
|
||||
key?: string; // TODO temporary, need refactor
|
||||
|
||||
|
@ -70,10 +93,14 @@ yarn workspace v1.22.19image` is a collocated image path, this entry will be the
|
|||
*/
|
||||
email?: string;
|
||||
/**
|
||||
* Unknown keys are allowed, so that we can pass custom fields to authors,
|
||||
* e.g., `twitter`.
|
||||
* Social platforms of the author
|
||||
* Usually displayed as a list of social icon links.
|
||||
*/
|
||||
[key: string]: unknown;
|
||||
socials?: AuthorSocials;
|
||||
/**
|
||||
* Unknown keys are allowed, so that we can pass custom fields to authors,
|
||||
*/
|
||||
[customAuthorAttribute: string]: unknown;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue