summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Halter2023-10-13 10:18:12 -0400
committerGitHub2023-10-13 16:18:12 +0200
commit71a52a16c44e3568128c83070541235133c44436 (patch)
tree7aea43aa2cae2999e1b24844f2a918b8a465561f
parent9fc0514d20988dea731cfbcc8cde1515f8b4f9f9 (diff)
downloadIT.starlight-71a52a16c44e3568128c83070541235133c44436.tar.gz
IT.starlight-71a52a16c44e3568128c83070541235133c44436.tar.bz2
IT.starlight-71a52a16c44e3568128c83070541235133c44436.zip
feat: add Reddit social icon (#854)
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
-rw-r--r--.changeset/clean-lies-wink.md5
-rw-r--r--docs/src/content/docs/guides/customization.mdx2
-rw-r--r--docs/src/content/docs/reference/configuration.md2
-rw-r--r--packages/starlight/components/Icons.ts2
-rw-r--r--packages/starlight/schemas/social.ts2
5 files changed, 11 insertions, 2 deletions
diff --git a/.changeset/clean-lies-wink.md b/.changeset/clean-lies-wink.md
new file mode 100644
index 00000000..d36b1301
--- /dev/null
+++ b/.changeset/clean-lies-wink.md
@@ -0,0 +1,5 @@
+---
+'@astrojs/starlight': patch
+---
+
+Add Reddit icon
diff --git a/docs/src/content/docs/guides/customization.mdx b/docs/src/content/docs/guides/customization.mdx
index 3a0905ee..a86cdb41 100644
--- a/docs/src/content/docs/guides/customization.mdx
+++ b/docs/src/content/docs/guides/customization.mdx
@@ -191,7 +191,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, Email, Facebook, GitHub, GitLab, Gitter, Instagram, LinkedIn, Mastodon, Microsoft Teams, an RSS feed, Stack Overflow, Telegram, Threads, Twitch, Twitter, X, and Youtube are supported.
+Currently, links to Bitbucket, Codeberg, CodePen, Discord, Email, Facebook, GitHub, GitLab, Gitter, Instagram, LinkedIn, Mastodon, Microsoft Teams, Reddit, an RSS feed, Stack Overflow, Telegram, Threads, Twitch, Twitter, X, 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 9cd51a22..9cdeaeed 100644
--- a/docs/src/content/docs/reference/configuration.md
+++ b/docs/src/content/docs/reference/configuration.md
@@ -308,7 +308,7 @@ The default locale will be used to provide fallback content where translations a
### `social`
-**type:** `Partial<Record<'bitbucket' | 'codeberg' | 'codePen' | 'discord' | 'email' | 'facebook' | 'github' | 'gitlab' | 'gitter' | 'instagram' | 'linkedin' | 'mastodon' | 'microsoftTeams' | 'rss' | 'stackOverflow' | 'telegram' | 'threads' | 'twitch' | 'twitter' | 'x.com' | 'youtube', string>>`
+**type:** `Partial<Record<'bitbucket' | 'codeberg' | 'codePen' | 'discord' | 'email' | 'facebook' | 'github' | 'gitlab' | 'gitter' | 'instagram' | 'linkedin' | 'mastodon' | 'microsoftTeams' | 'reddit' | 'rss' | 'stackOverflow' | 'telegram' | 'threads' | 'twitch' | 'twitter' | 'x.com' | 'youtube', string>>`
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 2f51cea7..711b3e75 100644
--- a/packages/starlight/components/Icons.ts
+++ b/packages/starlight/components/Icons.ts
@@ -95,4 +95,6 @@ export const Icons = {
'<path d="M20.9 2H3.1A1.1 1.1 0 0 0 2 3.1v17.8A1.1 1.1 0 0 0 3.1 22h9.58v-7.75h-2.6v-3h2.6V9a3.64 3.64 0 0 1 3.88-4 20.26 20.26 0 0 1 2.33.12v2.7H17.3c-1.26 0-1.5.6-1.5 1.47v1.93h3l-.39 3H15.8V22h5.1a1.1 1.1 0 0 0 1.1-1.1V3.1A1.1 1.1 0 0 0 20.9 2Z"/>',
email:
'<path d="M19 4H5a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3Zm-.41 2-5.88 5.88a1 1 0 0 1-1.42 0L5.41 6ZM20 17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7.41l5.88 5.88a3 3 0 0 0 4.24 0L20 7.41Z"/>',
+ reddit:
+ '<path d="M14.41 16.87a3.38 3.38 0 0 1-2.37.63 3.37 3.37 0 0 1-2.36-.63 1 1 0 0 0-1.42 1.41 5.11 5.11 0 0 0 3.78 1.22 5.12 5.12 0 0 0 3.78-1.22 1 1 0 1 0-1.41-1.41ZM9.2 15a1 1 0 1 0-1-1 1 1 0 0 0 1 1Zm6-2a1 1 0 1 0 1 1 1 1 0 0 0-1-1Zm7.8-1.22a3.77 3.77 0 0 0-6.8-2.26 16.5 16.5 0 0 0-3.04-.48l.85-5.7 2.09.7a3 3 0 0 0 6-.06v-.02a3.03 3.03 0 0 0-3-2.96 2.98 2.98 0 0 0-2.34 1.16l-3.24-1.1a1 1 0 0 0-1.3.8l-1.09 7.17a16.66 16.66 0 0 0-3.34.49 3.77 3.77 0 0 0-6.22 4.23A4.86 4.86 0 0 0 1 16c0 3.92 4.83 7 11 7s11-3.08 11-7a4.86 4.86 0 0 0-.57-2.25 3.78 3.78 0 0 0 .57-1.97ZM19.1 3a1 1 0 1 1-1 1 1.02 1.02 0 0 1 1-1ZM4.77 10a1.76 1.76 0 0 1 .88.25A9.98 9.98 0 0 0 3 11.92v-.14A1.78 1.78 0 0 1 4.78 10ZM12 21c-4.88 0-9-2.29-9-5s4.12-5 9-5 9 2.29 9 5-4.12 5-9 5Zm8.99-9.08a9.98 9.98 0 0 0-2.65-1.67 1.76 1.76 0 0 1 .88-.25A1.78 1.78 0 0 1 21 11.78l-.01.14Z"/>'
};
diff --git a/packages/starlight/schemas/social.ts b/packages/starlight/schemas/social.ts
index f199e766..b55dc944 100644
--- a/packages/starlight/schemas/social.ts
+++ b/packages/starlight/schemas/social.ts
@@ -25,6 +25,7 @@ export const SocialLinksSchema = () =>
'rss',
'facebook',
'email',
+ 'reddit',
]),
// Link to the respective social profile for this site
z.string().url()
@@ -57,6 +58,7 @@ export const SocialLinksSchema = () =>
rss: 'RSS',
facebook: 'Facebook',
email: 'Email',
+ reddit: 'Reddit',
}[key];
labelledLinks[key] = { label, url };
}