From 5726353f1a4815df9ab5a7acd7aea6af53383adc Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Tue, 29 Aug 2023 10:46:06 +0200 Subject: Add Stack Overflow icon (#559) --- .changeset/rare-insects-burn.md | 5 +++++ docs/src/content/docs/guides/customization.mdx | 2 +- docs/src/content/docs/reference/configuration.md | 2 +- packages/starlight/components/Icons.ts | 2 ++ packages/starlight/components/SocialIcons.astro | 1 + packages/starlight/utils/user-config.ts | 1 + 6 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .changeset/rare-insects-burn.md diff --git a/.changeset/rare-insects-burn.md b/.changeset/rare-insects-burn.md new file mode 100644 index 00000000..460f8393 --- /dev/null +++ b/.changeset/rare-insects-burn.md @@ -0,0 +1,5 @@ +--- +'@astrojs/starlight': patch +--- + +Add Stack Overflow icon diff --git a/docs/src/content/docs/guides/customization.mdx b/docs/src/content/docs/guides/customization.mdx index 8bbd5250..b0df53e9 100644 --- a/docs/src/content/docs/guides/customization.mdx +++ b/docs/src/content/docs/guides/customization.mdx @@ -178,7 +178,7 @@ defineConfig({ Starlight has built-in support for adding links to your social media accounts to the site header via the [`social`](/reference/configuration/#social) option in the Starlight integration. -Currently, links to Bitbucket, Codeberg, CodePen, Discord, GitHub, GitLab, Gitter, Instagram, LinkedIn, Mastodon, Microsoft Teams, Threads, Twitch, Twitter, and Youtube are supported. +Currently, links to Bitbucket, Codeberg, CodePen, Discord, GitHub, GitLab, Gitter, Instagram, LinkedIn, Mastodon, Microsoft Teams, Stack Overflow, Threads, Twitch, Twitter, and Youtube are supported. Let us know on GitHub or Discord if you need support for another service! ```js diff --git a/docs/src/content/docs/reference/configuration.md b/docs/src/content/docs/reference/configuration.md index 8f3a15da..738ad98e 100644 --- a/docs/src/content/docs/reference/configuration.md +++ b/docs/src/content/docs/reference/configuration.md @@ -295,7 +295,7 @@ The default locale will be used to provide fallback content where translations a ### `social` -**type:** `Partial>` +**type:** `Partial>` Optional details about the social media accounts for this site. Adding any of these will display them as icon links in the site header. diff --git a/packages/starlight/components/Icons.ts b/packages/starlight/components/Icons.ts index 262d5f01..68f1632f 100644 --- a/packages/starlight/components/Icons.ts +++ b/packages/starlight/components/Icons.ts @@ -84,4 +84,6 @@ export const Icons = { '', instagram: '', + stackOverflow: + '', }; diff --git a/packages/starlight/components/SocialIcons.astro b/packages/starlight/components/SocialIcons.astro index bb10a74d..2a42e71f 100644 --- a/packages/starlight/components/SocialIcons.astro +++ b/packages/starlight/components/SocialIcons.astro @@ -20,6 +20,7 @@ const labels: Record = { twitch: 'Twitch', microsoftTeams: 'Microsoft Teams', instagram: 'Instagram', + stackOverflow: 'Stack Overflow', }; const links = Object.entries(config.social || {}).filter(([, url]) => Boolean(url)) as [ diff --git a/packages/starlight/utils/user-config.ts b/packages/starlight/utils/user-config.ts index e91e0cdc..979f6c47 100644 --- a/packages/starlight/utils/user-config.ts +++ b/packages/starlight/utils/user-config.ts @@ -148,6 +148,7 @@ const UserConfigSchema = z.object({ 'twitch', 'microsoftTeams', 'instagram', + 'stackOverflow', ]), // Link to the respective social profile for this site z.string().url() -- cgit