From 6b23ebc9974828837a2de9175297664e5d28a999 Mon Sep 17 00:00:00 2001 From: Cédric Bontems Date: Fri, 30 Jun 2023 11:10:17 +0200 Subject: feat: add youtube social link support (#272) Co-authored-by: Chris Swithinbank --- .changeset/mean-icons-fetch.md | 5 +++++ docs/src/content/docs/fr/guides/customization.mdx | 12 +++++++----- docs/src/content/docs/fr/reference/configuration.md | 3 ++- docs/src/content/docs/guides/customization.mdx | 3 ++- docs/src/content/docs/reference/configuration.md | 3 ++- packages/starlight/components/Icons.ts | 2 ++ packages/starlight/utils/user-config.ts | 2 ++ 7 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 .changeset/mean-icons-fetch.md diff --git a/.changeset/mean-icons-fetch.md b/.changeset/mean-icons-fetch.md new file mode 100644 index 00000000..2913a63d --- /dev/null +++ b/.changeset/mean-icons-fetch.md @@ -0,0 +1,5 @@ +--- +"@astrojs/starlight": patch +--- + +Add YouTube social link support diff --git a/docs/src/content/docs/fr/guides/customization.mdx b/docs/src/content/docs/fr/guides/customization.mdx index f08d37ef..5ba999a3 100644 --- a/docs/src/content/docs/fr/guides/customization.mdx +++ b/docs/src/content/docs/fr/guides/customization.mdx @@ -178,7 +178,7 @@ defineConfig({ Starlight supporte par défaut l’ajout de liens vers vos comptes de médias sociaux dans l’en-tête du site via l’option [`social`](/reference/configuration/#social) dans l’intégration Starlight. -Actuellement, les liens vers Discord, GitHub, Mastodon et Twitter sont pris en charge. +Actuellement, les liens vers Codeberg, Discord, GitHub, Mastodon, Twitter et Youtube sont pris en charge. Faites-nous savoir sur GitHub ou Discord si vous avez besoin de la prise en charge d’un autre service ! ```js @@ -191,10 +191,12 @@ export default defineConfig({ starlight({ title: "Site avec des liens sociaux", social: { - discord: "https://astro.build/chat", - github: "https://github.com/withastro/starlight", - mastodon: "https://m.webtoo.ls/@astro", - twitter: "https://twitter.com/astrodotbuild", + codeberg: 'https://codeberg.org/knut/examples', + discord: 'https://astro.build/chat', + github: 'https://github.com/withastro/starlight', + mastodon: 'https://m.webtoo.ls/@astro', + twitter: 'https://twitter.com/astrodotbuild', + youtube: 'https://youtube.com/@astrodotbuild', }, }), ], diff --git a/docs/src/content/docs/fr/reference/configuration.md b/docs/src/content/docs/fr/reference/configuration.md index 0829cad2..8500e3c0 100644 --- a/docs/src/content/docs/fr/reference/configuration.md +++ b/docs/src/content/docs/fr/reference/configuration.md @@ -256,7 +256,7 @@ La locale par défaut sera utilisée pour fournir un contenu de remplacement lor ### `social` -**type:** `{ codeberg?: string; discord?: string; github?: string; mastodon?: string; twitter?: string }` +**type:** `{ codeberg?: string; discord?: string; github?: string; mastodon?: string; twitter?: string; youtube?: string }` Détails optionnels sur les comptes de médias sociaux pour ce site. L'ajout de l'un d'entre eux les affichera sous forme de liens iconiques dans l'en-tête du site. @@ -268,6 +268,7 @@ starlight({ github: 'https://github.com/withastro/starlight', mastodon: 'https://m.webtoo.ls/@astro', twitter: 'https://twitter.com/astrodotbuild', + youtube: 'https://youtube.com/@astrodotbuild', }, }); ``` diff --git a/docs/src/content/docs/guides/customization.mdx b/docs/src/content/docs/guides/customization.mdx index 5a34c7d7..f3c448f6 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 Codeberg, Discord, GitHub, Mastodon, and Twitter are supported. +Currently, links to Codeberg, Discord, GitHub, Mastodon, Twitter, and Youtube are supported. Let us know on GitHub or Discord if you need support for another service! ```js @@ -196,6 +196,7 @@ export default defineConfig({ github: 'https://github.com/withastro/starlight', mastodon: 'https://m.webtoo.ls/@astro', twitter: 'https://twitter.com/astrodotbuild', + youtube: 'https://youtube.com/@astrodotbuild', }, }), ], diff --git a/docs/src/content/docs/reference/configuration.md b/docs/src/content/docs/reference/configuration.md index f60e83a3..a291ae53 100644 --- a/docs/src/content/docs/reference/configuration.md +++ b/docs/src/content/docs/reference/configuration.md @@ -256,7 +256,7 @@ The default locale will be used to provide fallback content where translations a ### `social` -**type:** `{ codeberg?: string; discord?: string; github?: string; mastodon?: string; twitter?: string }` +**type:** `{ codeberg?: string; discord?: string; github?: string; mastodon?: string; twitter?: string; 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. @@ -268,6 +268,7 @@ starlight({ github: 'https://github.com/withastro/starlight', mastodon: 'https://m.webtoo.ls/@astro', twitter: 'https://twitter.com/astrodotbuild', + youtube: 'https://youtube.com/@astrodotbuild', }, }); ``` diff --git a/packages/starlight/components/Icons.ts b/packages/starlight/components/Icons.ts index a49d0b8a..abb1aec4 100644 --- a/packages/starlight/components/Icons.ts +++ b/packages/starlight/components/Icons.ts @@ -62,4 +62,6 @@ export const Icons = { '', codeberg: '', + youtube: + '', }; diff --git a/packages/starlight/utils/user-config.ts b/packages/starlight/utils/user-config.ts index 1de30129..af756d32 100644 --- a/packages/starlight/utils/user-config.ts +++ b/packages/starlight/utils/user-config.ts @@ -127,6 +127,8 @@ const UserConfigSchema = z.object({ discord: z.string().url().optional(), /** Link to the Codeberg profile or repository for this site, e.g. `'https://codeberg.org/knut/examples'`. */ codeberg: z.string().url().optional(), + /** Link to the Youtube channel for this site, e.g. `'https://www.youtube.com/@astrodotbuild'`. */ + youtube: z.string().url().optional(), }) .optional(), -- cgit