summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiDeoo2023-10-06 18:22:33 +0200
committerGitHub2023-10-06 18:22:33 +0200
commitb7b23a2c90a25fe8ea08338379b83d19c74d9037 (patch)
tree57d7990dbfce2d5559144548a91a56ecb1574bce
parent36bf557fe36299043e5a482918f6f79c662c55de (diff)
downloadIT.starlight-b7b23a2c90a25fe8ea08338379b83d19c74d9037.tar.gz
IT.starlight-b7b23a2c90a25fe8ea08338379b83d19c74d9037.tar.bz2
IT.starlight-b7b23a2c90a25fe8ea08338379b83d19c74d9037.zip
Add Facebook and email icons (#815)
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
-rw-r--r--.changeset/cyan-dingos-argue.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.ts4
-rw-r--r--packages/starlight/components/SocialIcons.astro2
-rw-r--r--packages/starlight/utils/user-config.ts2
6 files changed, 15 insertions, 2 deletions
diff --git a/.changeset/cyan-dingos-argue.md b/.changeset/cyan-dingos-argue.md
new file mode 100644
index 00000000..ae0d7964
--- /dev/null
+++ b/.changeset/cyan-dingos-argue.md
@@ -0,0 +1,5 @@
+---
+'@astrojs/starlight': patch
+---
+
+Add Facebook and email icons
diff --git a/docs/src/content/docs/guides/customization.mdx b/docs/src/content/docs/guides/customization.mdx
index 6c277c24..3a0905ee 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, 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, 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 5acaa356..9d742e46 100644
--- a/docs/src/content/docs/reference/configuration.md
+++ b/docs/src/content/docs/reference/configuration.md
@@ -307,7 +307,7 @@ The default locale will be used to provide fallback content where translations a
### `social`
-**type:** `Partial<Record<'bitbucket' | 'codeberg' | 'codePen' | 'discord' | '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' | '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 1a600e2b..6d48d01d 100644
--- a/packages/starlight/components/Icons.ts
+++ b/packages/starlight/components/Icons.ts
@@ -91,4 +91,8 @@ export const Icons = {
telegram:
'<path d="M22.26465,2.42773a2.04837,2.04837,0,0,0-2.07813-.32421L2.26562,9.33887a2.043,2.043,0,0,0,.1045,3.81836l3.625,1.26074,2.0205,6.68164A.998.998,0,0,0,8.134,21.352c.00775.012.01868.02093.02692.03259a.98844.98844,0,0,0,.21143.21576c.02307.01758.04516.03406.06982.04968a.98592.98592,0,0,0,.31073.13611l.01184.001.00671.00287a1.02183,1.02183,0,0,0,.20215.02051c.00653,0,.01233-.00312.0188-.00324a.99255.99255,0,0,0,.30109-.05231c.02258-.00769.04193-.02056.06384-.02984a.9931.9931,0,0,0,.20429-.11456,250.75993,250.75993,0,0,1,.15222-.12818L12.416,18.499l4.03027,3.12207a2.02322,2.02322,0,0,0,1.24121.42676A2.05413,2.05413,0,0,0,19.69531,20.415L22.958,4.39844A2.02966,2.02966,0,0,0,22.26465,2.42773ZM9.37012,14.73633a.99357.99357,0,0,0-.27246.50586l-.30951,1.504-.78406-2.59307,4.06525-2.11695ZM17.67188,20.04l-4.7627-3.68945a1.00134,1.00134,0,0,0-1.35352.11914l-.86541.9552.30584-1.48645,7.083-7.083a.99975.99975,0,0,0-1.16894-1.59375L6.74487,12.55432,3.02051,11.19141,20.999,3.999Z"/>',
rss: '<path d="M2.88,16.88a3,3,0,0,0,0,4.24,3,3,0,0,0,4.24,0,3,3,0,0,0-4.24-4.24Zm2.83,2.83a1,1,0,0,1-1.42-1.42,1,1,0,0,1,1.42,0A1,1,0,0,1,5.71,19.71ZM5,12a1,1,0,0,0,0,2,5,5,0,0,1,5,5,1,1,0,0,0,2,0,7,7,0,0,0-7-7ZM5,8a1,1,0,0,0,0,2,9,9,0,0,1,9,9,1,1,0,0,0,2,0,11.08,11.08,0,0,0-3.22-7.78A11.08,11.08,0,0,0,5,8Zm10.61.39A15.11,15.11,0,0,0,5,4,1,1,0,0,0,5,6,13,13,0,0,1,18,19a1,1,0,0,0,2,0A15.11,15.11,0,0,0,15.61,8.39Z"/>',
+ facebook:
+ '<path d="M20.9,2H3.1A1.1,1.1,0,0,0,2,3.1V20.9A1.1,1.1,0,0,0,3.1,22h9.58V14.25h-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,22,20.9V3.1A1.1,1.1,0,0,0,20.9,2Z"/>',
+ email:
+ '<path d="M19,4H5A3,3,0,0,0,2,7V17a3,3,0,0,0,3,3H19a3,3,0,0,0,3-3V7A3,3,0,0,0,19,4Zm-.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"/>',
};
diff --git a/packages/starlight/components/SocialIcons.astro b/packages/starlight/components/SocialIcons.astro
index 70ca8bd6..4f5803a3 100644
--- a/packages/starlight/components/SocialIcons.astro
+++ b/packages/starlight/components/SocialIcons.astro
@@ -24,6 +24,8 @@ const labels: Record<Platform, string> = {
'x.com': 'X',
telegram: 'Telegram',
rss: 'RSS',
+ facebook: 'Facebook',
+ email: 'Email',
};
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 8b4f195b..ccaf0745 100644
--- a/packages/starlight/utils/user-config.ts
+++ b/packages/starlight/utils/user-config.ts
@@ -155,6 +155,8 @@ const UserConfigSchema = z.object({
'x.com',
'telegram',
'rss',
+ 'facebook',
+ 'email',
]),
// Link to the respective social profile for this site
z.string().url()