diff options
author | Cédric Bontems | 2023-06-30 11:10:17 +0200 |
---|---|---|
committer | GitHub | 2023-06-30 11:10:17 +0200 |
commit | 6b23ebc9974828837a2de9175297664e5d28a999 (patch) | |
tree | a9eb7b246899f14d7fe19e19c5ba31fd95328a07 | |
parent | d4f5134c91b393ac448efc3f44849fc886a05551 (diff) | |
download | IT.starlight-6b23ebc9974828837a2de9175297664e5d28a999.tar.gz IT.starlight-6b23ebc9974828837a2de9175297664e5d28a999.tar.bz2 IT.starlight-6b23ebc9974828837a2de9175297664e5d28a999.zip |
feat: add youtube social link support (#272)
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
-rw-r--r-- | .changeset/mean-icons-fetch.md | 5 | ||||
-rw-r--r-- | docs/src/content/docs/fr/guides/customization.mdx | 12 | ||||
-rw-r--r-- | docs/src/content/docs/fr/reference/configuration.md | 3 | ||||
-rw-r--r-- | docs/src/content/docs/guides/customization.mdx | 3 | ||||
-rw-r--r-- | docs/src/content/docs/reference/configuration.md | 3 | ||||
-rw-r--r-- | packages/starlight/components/Icons.ts | 2 | ||||
-rw-r--r-- | packages/starlight/utils/user-config.ts | 2 |
7 files changed, 22 insertions, 8 deletions
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 = { '<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: '<path d="M12 .5a12 12 0 0 0-12 12 12 12 0 0 0 1.8 6.4l10-13a.2.1 0 0 1 .4 0l10 13a12 12 0 0 0 1.8-6.4 12 12 0 0 0-12-12zm.3 6.5 4.4 16.5a12 12 0 0 0 5.2-4.2z"/>', + youtube: + '<path d="M23.5 6.2A3 3 0 0 0 21.4 4c-1.9-.5-9.4-.5-9.4-.5s-7.5 0-9.4.5A3 3 0 0 0 .5 6.3C0 8 0 12 0 12s0 4 .5 5.8A3 3 0 0 0 2.6 20c1.9.6 9.4.6 9.4.6s7.5 0 9.4-.6a3 3 0 0 0 2.1-2c.5-2 .5-5.9.5-5.9s0-4-.5-5.8zm-14 9.4V8.4l6.3 3.6-6.3 3.6z"/>', }; 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(), |