From df48c10363c9bca3b5964659d464670497ac1ca3 Mon Sep 17 00:00:00 2001 From: Chas Emerick Date: Fri, 13 Dec 2024 10:02:35 -0500 Subject: [PATCH] add social icons for mastodon and bluesky --- .../src/theme-classic.d.ts | 16 ++++++++++ .../Blog/Components/Author/Socials/index.tsx | 4 +++ .../src/theme/Icon/Socials/Bluesky/index.tsx | 27 ++++++++++++++++ .../src/theme/Icon/Socials/Mastodon/index.tsx | 31 +++++++++++++++++++ project-words.txt | 2 ++ .../2024-07-03-multiple-authors.mdx | 2 ++ website/_dogfooding/_blog tests/authors.yml | 1 + 7 files changed, 83 insertions(+) create mode 100644 packages/docusaurus-theme-classic/src/theme/Icon/Socials/Bluesky/index.tsx create mode 100644 packages/docusaurus-theme-classic/src/theme/Icon/Socials/Mastodon/index.tsx diff --git a/packages/docusaurus-theme-classic/src/theme-classic.d.ts b/packages/docusaurus-theme-classic/src/theme-classic.d.ts index 6b5c40d73047..efc8edbe38f5 100644 --- a/packages/docusaurus-theme-classic/src/theme-classic.d.ts +++ b/packages/docusaurus-theme-classic/src/theme-classic.d.ts @@ -1708,6 +1708,22 @@ declare module '@theme/Icon/Socials/StackOverflow' { export default function StackOverflow(props: Props): ReactNode; } +declare module '@theme/Icon/Socials/Mastodon' { + import type {ComponentProps, ReactNode} from 'react'; + + export interface Props extends ComponentProps<'svg'> {} + + export default function Mastodon(props: Props): ReactNode; +} + +declare module '@theme/Icon/Socials/Bluesky' { + import type {ComponentProps, ReactNode} from 'react'; + + export interface Props extends ComponentProps<'svg'> {} + + export default function Bluesky(props: Props): ReactNode; +} + declare module '@theme/TagsListByLetter' { import type {ReactNode} from 'react'; import type {TagsListItem} from '@docusaurus/utils'; diff --git a/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/Socials/index.tsx b/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/Socials/index.tsx index a632bd62addd..44df1b1befdd 100644 --- a/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/Socials/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/Socials/index.tsx @@ -16,6 +16,8 @@ import GitHub from '@theme/Icon/Socials/GitHub'; import X from '@theme/Icon/Socials/X'; import StackOverflow from '@theme/Icon/Socials/StackOverflow'; import LinkedIn from '@theme/Icon/Socials/LinkedIn'; +import Mastodon from '@theme/Icon/Socials/Mastodon'; +import Bluesky from '@theme/Icon/Socials/Bluesky'; import DefaultSocialIcon from '@theme/Icon/Socials/Default'; import styles from './styles.module.css'; @@ -30,6 +32,8 @@ const SocialPlatformConfigs: Record = { stackoverflow: {Icon: StackOverflow, label: 'Stack Overflow'}, linkedin: {Icon: LinkedIn, label: 'LinkedIn'}, x: {Icon: X, label: 'X'}, + mastodon: {Icon: Mastodon, label: 'Mastodon'}, + bluesky: {Icon: Bluesky, label: 'Bluesky'}, }; function getSocialPlatformConfig(platformKey: string): SocialPlatformConfig { diff --git a/packages/docusaurus-theme-classic/src/theme/Icon/Socials/Bluesky/index.tsx b/packages/docusaurus-theme-classic/src/theme/Icon/Socials/Bluesky/index.tsx new file mode 100644 index 000000000000..961e4bf56a2b --- /dev/null +++ b/packages/docusaurus-theme-classic/src/theme/Icon/Socials/Bluesky/index.tsx @@ -0,0 +1,27 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import type {ReactNode, SVGProps} from 'react'; + +// SVG Source: https://svgl.app/ +function Bluesky(props: SVGProps): ReactNode { + return ( + + + + ); +} +export default Bluesky; diff --git a/packages/docusaurus-theme-classic/src/theme/Icon/Socials/Mastodon/index.tsx b/packages/docusaurus-theme-classic/src/theme/Icon/Socials/Mastodon/index.tsx new file mode 100644 index 000000000000..b001ce53fcfb --- /dev/null +++ b/packages/docusaurus-theme-classic/src/theme/Icon/Socials/Mastodon/index.tsx @@ -0,0 +1,31 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import type {ReactNode, SVGProps} from 'react'; + +// SVG Source: https://svgl.app/ +function Mastodon(props: SVGProps): ReactNode { + return ( + + + + + ); +} +export default Mastodon; diff --git a/project-words.txt b/project-words.txt index 9cef579226d0..e758a89ee438 100644 --- a/project-words.txt +++ b/project-words.txt @@ -25,6 +25,7 @@ beforeinstallprompt Bhatt blockquotes Blockquotes +bluesky Bokmål bunx caabernathy @@ -155,6 +156,7 @@ Marcey's markprompt Markprompt Massoud +mastodon mathjax maxlynch maxresdefault diff --git a/website/_dogfooding/_blog tests/2024-07-03-multiple-authors.mdx b/website/_dogfooding/_blog tests/2024-07-03-multiple-authors.mdx index eaf0b91ec48f..03420a6dc85b 100644 --- a/website/_dogfooding/_blog tests/2024-07-03-multiple-authors.mdx +++ b/website/_dogfooding/_blog tests/2024-07-03-multiple-authors.mdx @@ -10,6 +10,8 @@ authors: stackoverflow: https://stackoverflow.com/users/82609/sebastien-lorber linkedin: https://www.linkedin.com/in/sebastienlorber/ newsletter: https://thisweekinreact.com/newsletter + bluesky: https://bsky.app/profile/sebastienlorber.com + mastodon: https://mastodon.social/@sebastienlorber - name: Sébastien Lorber imageURL: https://github.com/slorber.png socials: diff --git a/website/_dogfooding/_blog tests/authors.yml b/website/_dogfooding/_blog tests/authors.yml index a7dac6a959ac..ff320f9b122e 100644 --- a/website/_dogfooding/_blog tests/authors.yml +++ b/website/_dogfooding/_blog tests/authors.yml @@ -6,6 +6,7 @@ slorber: page: true socials: x: sebastienlorber + bluesky: https://bsky.app/profile/sebastienlorber.com ozaki: name: ozaki