From f08b0dff9638bbe7704ac2ba2e855d8d1464ba76 Mon Sep 17 00:00:00 2001 From: techfg Date: Wed, 10 Apr 2024 11:26:45 -0400 Subject: [PATCH 01/32] fix: respond to media query change events when theme is `auto` (#1731) Co-authored-by: Chris Swithinbank --- .changeset/swift-files-wave.md | 5 +++++ packages/starlight/components/ThemeSelect.astro | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 .changeset/swift-files-wave.md diff --git a/.changeset/swift-files-wave.md b/.changeset/swift-files-wave.md new file mode 100644 index 00000000000..694a0b6de52 --- /dev/null +++ b/.changeset/swift-files-wave.md @@ -0,0 +1,5 @@ +--- +'@astrojs/starlight': patch +--- + +Fixes responding to system color scheme changes when theme is `auto` diff --git a/packages/starlight/components/ThemeSelect.astro b/packages/starlight/components/ThemeSelect.astro index de88627d2d6..8467a43b35e 100644 --- a/packages/starlight/components/ThemeSelect.astro +++ b/packages/starlight/components/ThemeSelect.astro @@ -42,6 +42,9 @@ const { labels } = Astro.props; this.#onThemeChange(this.#parseTheme(e.currentTarget.value)); } }); + matchMedia(`(prefers-color-scheme: light)`).addEventListener('change', () => { + if (this.#loadTheme() === 'auto') this.#onThemeChange('auto'); + }); } } From 923405faf4f385e31af1d59134a64cd5852bf4a1 Mon Sep 17 00:00:00 2001 From: Nin3 <30520689+Nin3lee@users.noreply.github.com> Date: Thu, 11 Apr 2024 00:37:26 +0800 Subject: [PATCH 02/32] i18n(zh-cn): Update i18n.mdx (#1732) Co-authored-by: HiDeoo <494699+HiDeoo@users.noreply.github.com> Co-authored-by: liruifengv <25167721+liruifengv@users.noreply.github.com> --- docs/src/content/docs/zh-cn/guides/i18n.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/content/docs/zh-cn/guides/i18n.mdx b/docs/src/content/docs/zh-cn/guides/i18n.mdx index 6e954583ec5..79d4cd3d95b 100644 --- a/docs/src/content/docs/zh-cn/guides/i18n.mdx +++ b/docs/src/content/docs/zh-cn/guides/i18n.mdx @@ -113,7 +113,7 @@ export default defineConfig({ #### 单语言网站 -默认情况查下,Starlight 是一个单语言(英语)网站。要在其他语言中创建单语言网站,请将其设置为 `locales` 配置中的 `root`: +默认情况下,Starlight 是一个单语言(英语)网站。要在其他语言中创建单语言网站,请将其设置为 `locales` 配置中的 `root`: ```diff lang="js" {10-13} // astro.config.mjs From 782f80377c644ed5b24fcb5d5624bdd1403ff301 Mon Sep 17 00:00:00 2001 From: Martin Trapp <94928215+martrapp@users.noreply.github.com> Date: Wed, 10 Apr 2024 22:07:21 +0200 Subject: [PATCH 03/32] Adds the guide on enabling view transitions to Recipes and Guides (#1737) Co-authored-by: Chris Swithinbank --- docs/src/content/docs/resources/community-content.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/src/content/docs/resources/community-content.mdx b/docs/src/content/docs/resources/community-content.mdx index 0ea2b4e1bb9..f2a6fec3ba5 100644 --- a/docs/src/content/docs/resources/community-content.mdx +++ b/docs/src/content/docs/resources/community-content.mdx @@ -74,7 +74,11 @@ Explore community-produced content maintained by Starlight users: title="Publishing Documentation with Astro Starlight" description="Getting started with Starlight documentation" /> - + ## Video Content From 08ef8cb733673c81e0b4d56f743275965728b7a8 Mon Sep 17 00:00:00 2001 From: delucis Date: Wed, 10 Apr 2024 20:08:04 +0000 Subject: [PATCH 04/32] [ci] format --- docs/src/content/docs/resources/community-content.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/content/docs/resources/community-content.mdx b/docs/src/content/docs/resources/community-content.mdx index f2a6fec3ba5..c4bda99bd7c 100644 --- a/docs/src/content/docs/resources/community-content.mdx +++ b/docs/src/content/docs/resources/community-content.mdx @@ -74,7 +74,7 @@ Explore community-produced content maintained by Starlight users: title="Publishing Documentation with Astro Starlight" description="Getting started with Starlight documentation" /> - Date: Wed, 10 Apr 2024 22:10:25 +0200 Subject: [PATCH 05/32] Refactor `` script to avoid double media query event listener (#1734) --- .changeset/sweet-vans-carry.md | 5 ++ .../starlight/components/ThemeSelect.astro | 87 ++++++++----------- packages/starlight/global.d.ts | 2 +- 3 files changed, 42 insertions(+), 52 deletions(-) create mode 100644 .changeset/sweet-vans-carry.md diff --git a/.changeset/sweet-vans-carry.md b/.changeset/sweet-vans-carry.md new file mode 100644 index 00000000000..3005a1dcf23 --- /dev/null +++ b/.changeset/sweet-vans-carry.md @@ -0,0 +1,5 @@ +--- +'@astrojs/starlight': patch +--- + +Refactors `` custom element logic to improve performance diff --git a/packages/starlight/components/ThemeSelect.astro b/packages/starlight/components/ThemeSelect.astro index 8467a43b35e..970156028ee 100644 --- a/packages/starlight/components/ThemeSelect.astro +++ b/packages/starlight/components/ThemeSelect.astro @@ -28,65 +28,50 @@ const { labels } = Astro.props; diff --git a/packages/starlight/global.d.ts b/packages/starlight/global.d.ts index 6b31ebeac65..13121ecaffa 100644 --- a/packages/starlight/global.d.ts +++ b/packages/starlight/global.d.ts @@ -1,4 +1,4 @@ -declare global { +export declare global { var StarlightThemeProvider: { updatePickers(theme?: string): void; }; From de0d6a1323a7c72fdf97084d60082f2427aa97f9 Mon Sep 17 00:00:00 2001 From: huyikai Date: Thu, 11 Apr 2024 10:45:56 +0800 Subject: [PATCH 06/32] i18n(zh-cn): Update `community-content.mdx` (#1742) * i18n(zh-cn): Update `community-content.mdx` * Update docs/src/content/docs/zh-cn/resources/community-content.mdx Co-authored-by: liruifengv * Update docs/src/content/docs/zh-cn/resources/community-content.mdx Co-authored-by: liruifengv --------- Co-authored-by: liruifengv --- docs/src/content/docs/zh-cn/resources/community-content.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/src/content/docs/zh-cn/resources/community-content.mdx b/docs/src/content/docs/zh-cn/resources/community-content.mdx index 12375fb2b54..78b4365af23 100644 --- a/docs/src/content/docs/zh-cn/resources/community-content.mdx +++ b/docs/src/content/docs/zh-cn/resources/community-content.mdx @@ -74,7 +74,11 @@ import { CardGrid, LinkCard } from '@astrojs/starlight/components'; title="使用 Astro Starlight 发布文档" description="开始使用 Starlight 文档" /> - + ## 视频内容 From 76e5ddf6f85dd8bec3e584753e6b5ab8b86d5901 Mon Sep 17 00:00:00 2001 From: Junseong Park Date: Thu, 11 Apr 2024 18:13:04 +0900 Subject: [PATCH 07/32] i18n(ko-KR): update `community-content.mdx` (#1743) --- docs/src/content/docs/ko/resources/community-content.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/src/content/docs/ko/resources/community-content.mdx b/docs/src/content/docs/ko/resources/community-content.mdx index b69be0f62af..c1dd5eaf6ad 100644 --- a/docs/src/content/docs/ko/resources/community-content.mdx +++ b/docs/src/content/docs/ko/resources/community-content.mdx @@ -74,7 +74,11 @@ Starlight 사용자들이 관리하는 커뮤니티 제작 콘텐츠를 살펴 title="Astro Starlight로 문서 게시" description="Starlight 문서 시작하기" /> - + ## 영상 콘텐츠 From f53469214869a0ef7f748d6d1c6949726d3e7acf Mon Sep 17 00:00:00 2001 From: HiDeoo <494699+HiDeoo@users.noreply.github.com> Date: Thu, 11 Apr 2024 13:13:44 +0200 Subject: [PATCH 08/32] i18n(fr): update `resources/community-content` (#1744) --- docs/src/content/docs/fr/resources/community-content.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/src/content/docs/fr/resources/community-content.mdx b/docs/src/content/docs/fr/resources/community-content.mdx index 9ca0109eea0..5d23180e0b6 100644 --- a/docs/src/content/docs/fr/resources/community-content.mdx +++ b/docs/src/content/docs/fr/resources/community-content.mdx @@ -74,7 +74,11 @@ Explorez le contenu communautaire produit par les utilisateurs de Starlight : title="Publier une documentation avec Astro Starlight" description="Démarrer une documentation avec Starlight" /> - + ## Contenu vidéo From c45351b943e295cbd268521b055d066ead9f8e53 Mon Sep 17 00:00:00 2001 From: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> Date: Thu, 11 Apr 2024 05:31:26 -0600 Subject: [PATCH 09/32] i18n(es): update `configuration` (#1739) --- docs/src/content/docs/es/reference/configuration.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/content/docs/es/reference/configuration.mdx b/docs/src/content/docs/es/reference/configuration.mdx index 42ef859d5d0..3550cf90c1f 100644 --- a/docs/src/content/docs/es/reference/configuration.mdx +++ b/docs/src/content/docs/es/reference/configuration.mdx @@ -489,14 +489,14 @@ Si necesitas establecer variantes adicionales o favicons de respaldo, puedes agr ```js starlight({ - favicon: '/images/favicon.svg'. + favicon: '/images/favicon.svg', head: [ // Agregar un favicon ICO de respaldo para Safari. { tag: 'link', attrs: { rel: 'icon', - href:'/images/favicon.ico', + href: '/images/favicon.ico', sizes: '32x32', }, }, From 4c4d4d05ceda11cfb8f089f52072ca5c10281607 Mon Sep 17 00:00:00 2001 From: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> Date: Thu, 11 Apr 2024 05:31:39 -0600 Subject: [PATCH 10/32] i18n(es): update `showcase` (#1741) --- docs/src/content/docs/es/resources/showcase.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/content/docs/es/resources/showcase.mdx b/docs/src/content/docs/es/resources/showcase.mdx index 21902d30753..979d8be196f 100644 --- a/docs/src/content/docs/es/resources/showcase.mdx +++ b/docs/src/content/docs/es/resources/showcase.mdx @@ -7,7 +7,7 @@ sidebar: :::tip[¡Agrega el tuyo!] ¿Has construido un sitio de Starlight o una herramienta para Starlight? -¡Abre una PR agregando un enlace a esta página! +¡[Abre una PR](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md#showcase) agregando un enlace a esta página! ::: ## Sitios From 3770ad06167ac3655313c31fcd6e8a71e3e6161a Mon Sep 17 00:00:00 2001 From: delucis Date: Thu, 11 Apr 2024 11:32:30 +0000 Subject: [PATCH 11/32] [ci] format --- .../docs/es/reference/configuration.mdx | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/src/content/docs/es/reference/configuration.mdx b/docs/src/content/docs/es/reference/configuration.mdx index 3550cf90c1f..bc5d0ea0339 100644 --- a/docs/src/content/docs/es/reference/configuration.mdx +++ b/docs/src/content/docs/es/reference/configuration.mdx @@ -489,18 +489,18 @@ Si necesitas establecer variantes adicionales o favicons de respaldo, puedes agr ```js starlight({ - favicon: '/images/favicon.svg', - head: [ - // Agregar un favicon ICO de respaldo para Safari. - { - tag: 'link', - attrs: { - rel: 'icon', - href: '/images/favicon.ico', - sizes: '32x32', - }, - }, - ], + favicon: '/images/favicon.svg', + head: [ + // Agregar un favicon ICO de respaldo para Safari. + { + tag: 'link', + attrs: { + rel: 'icon', + href: '/images/favicon.ico', + sizes: '32x32', + }, + }, + ], }); ``` From f013c5fdb4a8be99ad2e4dc8fcd4f2979e602bc9 Mon Sep 17 00:00:00 2001 From: Atharva Date: Thu, 11 Apr 2024 20:31:40 +0530 Subject: [PATCH 12/32] i18n(hi): update outdated hindi pages (#1730) Co-authored-by: Chris Swithinbank --- .../src/content/docs/hi/guides/components.mdx | 159 ++++++++++++++---- .../docs/hi/guides/css-and-tailwind.mdx | 12 +- .../content/docs/hi/guides/customization.mdx | 18 +- docs/src/content/docs/hi/guides/i18n.mdx | 40 ++--- .../content/docs/hi/guides/site-search.mdx | 10 +- 5 files changed, 174 insertions(+), 65 deletions(-) diff --git a/docs/src/content/docs/hi/guides/components.mdx b/docs/src/content/docs/hi/guides/components.mdx index a83ce364af7..45f9b02e4ca 100644 --- a/docs/src/content/docs/hi/guides/components.mdx +++ b/docs/src/content/docs/hi/guides/components.mdx @@ -59,6 +59,7 @@ import { Tabs, TabItem } from '@astrojs/starlight/components'; आप `` और `` अवयवों का उपयोग करके एक टैब्ड इंटरफ़ेस प्रदर्शित कर सकते हैं। प्रत्येक `` में उपयोगकर्ताओं को प्रदर्शित करने के लिए एक `label` होना चाहिए। +लेबल के आगे [Starlight के अंतर्निर्मित आइकन](#सभी-आइकन) में से एक को शामिल करने के लिए वैकल्पिक `icon` विशेषता का उपयोग करें। ```mdx # src/content/docs/example.mdx @@ -66,16 +67,24 @@ import { Tabs, TabItem } from '@astrojs/starlight/components'; import { Tabs, TabItem } from '@astrojs/starlight/components'; - Sirius, Vega, Betelgeuse - Io, Europa, Ganymede + + Sirius, Vega, Betelgeuse + + + Io, Europa, Ganymede + ``` उपरोक्त कोड पेज पर निम्नलिखित टैब उत्पन्न करता है: - Sirius, Vega, Betelgeuse - Io, Europa, Ganymede + + Sirius, Vega, Betelgeuse + + + Io, Europa, Ganymede + ### कार्ड @@ -224,33 +233,6 @@ import { Aside } from '@astrojs/starlight/components'; Starlight `