summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrien Pinet2023-10-03 00:28:21 +0200
committerGitHub2023-10-03 00:28:21 +0200
commit6833ee12159ea5be23885c41da80569a89aafa33 (patch)
tree9c14cc065c786c1a3b09c19ce9f862d45ad6f020
parenta0de12d596ab2b1c0d79d6d63d2d6cb9fe6d2644 (diff)
downloadIT.starlight-6833ee12159ea5be23885c41da80569a89aafa33.tar.gz
IT.starlight-6833ee12159ea5be23885c41da80569a89aafa33.tar.bz2
IT.starlight-6833ee12159ea5be23885c41da80569a89aafa33.zip
add twitter new logo (#752)
Co-authored-by: Adrien Pinet <apinet@users.noreply.github.com> Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
-rw-r--r--.changeset/clever-moose-drum.md5
-rw-r--r--docs/src/content/docs/guides/customization.mdx2
-rw-r--r--docs/src/content/docs/reference/configuration.md3
-rw-r--r--packages/starlight/components/Icons.ts2
-rw-r--r--packages/starlight/components/SocialIcons.astro1
-rw-r--r--packages/starlight/utils/user-config.ts1
6 files changed, 12 insertions, 2 deletions
diff --git a/.changeset/clever-moose-drum.md b/.changeset/clever-moose-drum.md
new file mode 100644
index 00000000..f5ba28bb
--- /dev/null
+++ b/.changeset/clever-moose-drum.md
@@ -0,0 +1,5 @@
+---
+"@astrojs/starlight": patch
+---
+
+Add X social link logo
diff --git a/docs/src/content/docs/guides/customization.mdx b/docs/src/content/docs/guides/customization.mdx
index 09a136f2..6c277c24 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, and Youtube are supported.
+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.
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 c0c27691..aeae37cc 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' | 'youtube', string>>`
+**type:** `Partial<Record<'bitbucket' | 'codeberg' | 'codePen' | 'discord' | '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.
@@ -323,6 +323,7 @@ starlight({
threads: 'https://www.threads.net/@nmoodev',
twitch: 'https://www.twitch.tv/bholmesdev',
twitter: 'https://twitter.com/astrodotbuild',
+ 'x.com': 'https://x.com/astrodotbuild',
youtube: 'https://youtube.com/@astrodotbuild',
},
});
diff --git a/packages/starlight/components/Icons.ts b/packages/starlight/components/Icons.ts
index 90fb5e1d..1a600e2b 100644
--- a/packages/starlight/components/Icons.ts
+++ b/packages/starlight/components/Icons.ts
@@ -68,6 +68,8 @@ export const Icons = {
'<path d="M6.11 15.12H3.75V0h2.36v15.12zm4.71-11.55H8.46V24h2.36V3.57zm4.72 0h-2.36V24h2.36V3.57zm4.71 0h-2.36v11.57h2.36V3.56z"/>',
twitter:
'<path d="M24 4.4a10 10 0 0 1-2.83.78 5.05 5.05 0 0 0 2.17-2.79 9.7 9.7 0 0 1-3.13 1.23 4.89 4.89 0 0 0-5.94-1.03 5 5 0 0 0-2.17 2.38 5.15 5.15 0 0 0-.3 3.25c-1.95-.1-3.86-.63-5.61-1.53a14.04 14.04 0 0 1-4.52-3.74 5.2 5.2 0 0 0-.09 4.91c.39.74.94 1.35 1.61 1.82a4.77 4.77 0 0 1-2.23-.63v.06c0 1.16.4 2.29 1.12 3.18a4.9 4.9 0 0 0 2.84 1.74c-.73.22-1.5.26-2.24.12a4.89 4.89 0 0 0 4.59 3.49A9.78 9.78 0 0 1 0 19.73 13.65 13.65 0 0 0 7.55 22a13.63 13.63 0 0 0 9.96-4.16A14.26 14.26 0 0 0 21.6 7.65V7c.94-.72 1.75-1.6 2.4-2.6Z"/>',
+ 'x.com':
+ '<path d="M 18.242188 2.25 L 21.554688 2.25 L 14.324219 10.507812 L 22.828125 21.75 L 16.171875 21.75 L 10.953125 14.933594 L 4.992188 21.75 L 1.679688 21.75 L 9.40625 12.914062 L 1.257812 2.25 L 8.082031 2.25 L 12.792969 8.480469 Z M 17.082031 19.773438 L 18.914062 19.773438 L 7.082031 4.125 L 5.113281 4.125 Z M 17.082031 19.773438 "/>',
mastodon:
'<path d="M16.45 17.77c2.77-.33 5.18-2.03 5.49-3.58.47-2.45.44-5.97.44-5.97 0-4.77-3.15-6.17-3.15-6.17-1.58-.72-4.3-1.03-7.13-1.05h-.07c-2.83.02-5.55.33-7.13 1.05 0 0-3.14 1.4-3.14 6.17v.91c-.01.88-.02 1.86 0 2.88.12 4.67.87 9.27 5.2 10.4 2 .53 3.72.64 5.1.57 2.51-.14 3.92-.9 3.92-.9l-.08-1.8s-1.8.56-3.8.5c-2-.08-4.1-.22-4.43-2.66a4.97 4.97 0 0 1-.04-.68s1.96.48 4.44.59c1.51.07 2.94-.09 4.38-.26Zm2.22-3.4h-2.3v-5.6c0-1.19-.5-1.79-1.5-1.79-1.1 0-1.66.71-1.66 2.12v3.07h-2.3V9.1c0-1.4-.55-2.12-1.65-2.12-1 0-1.5.6-1.5 1.78v5.61h-2.3V8.6c0-1.18.3-2.12.9-2.81a3.17 3.17 0 0 1 2.47-1.05c1.18 0 2.07.45 2.66 1.35l.57.96.58-.96a2.97 2.97 0 0 1 2.66-1.35c1.01 0 1.83.36 2.46 1.05.6.7.9 1.63.9 2.81v5.78Z"/>',
codeberg:
diff --git a/packages/starlight/components/SocialIcons.astro b/packages/starlight/components/SocialIcons.astro
index a8be5698..70ca8bd6 100644
--- a/packages/starlight/components/SocialIcons.astro
+++ b/packages/starlight/components/SocialIcons.astro
@@ -21,6 +21,7 @@ const labels: Record<Platform, string> = {
microsoftTeams: 'Microsoft Teams',
instagram: 'Instagram',
stackOverflow: 'Stack Overflow',
+ 'x.com': 'X',
telegram: 'Telegram',
rss: 'RSS',
};
diff --git a/packages/starlight/utils/user-config.ts b/packages/starlight/utils/user-config.ts
index 49c70479..fb7b7226 100644
--- a/packages/starlight/utils/user-config.ts
+++ b/packages/starlight/utils/user-config.ts
@@ -152,6 +152,7 @@ const UserConfigSchema = z.object({
'microsoftTeams',
'instagram',
'stackOverflow',
+ 'x.com',
'telegram',
'rss',
]),