diff --git a/docs/src/content/docs/fr/getting-started.mdx b/docs/src/content/docs/fr/getting-started.mdx index 4c38de663f3..7c00093bbde 100644 --- a/docs/src/content/docs/fr/getting-started.mdx +++ b/docs/src/content/docs/fr/getting-started.mdx @@ -15,7 +15,7 @@ Consultez les [instructions d'installation manuelle](/fr/manual-setup/) pour ajo Créez un nouveau projet Astro + Starlight en lançant la commande suivante dans votre terminal : - + ```sh @@ -52,7 +52,7 @@ Lorsque vous travaillez localement, [le serveur de développement d'Astro](https À l'intérieur du répertoire de votre projet, exécutez la commande suivante pour démarrer le serveur de développement : - + ```sh @@ -103,7 +103,7 @@ Assurez-vous de mettre à jour Starlight régulièrement ! Starlight est une intégration Astro. Vous pouvez la mettre à jour ainsi que tous autres packages Astro en exécutant la commande suivante dans votre terminal : - + ```sh diff --git a/docs/src/content/docs/fr/guides/components.mdx b/docs/src/content/docs/fr/guides/components.mdx index e9e13b4a970..94f5e93fdf3 100644 --- a/docs/src/content/docs/fr/guides/components.mdx +++ b/docs/src/content/docs/fr/guides/components.mdx @@ -87,6 +87,51 @@ Le code ci-dessus génère les onglets suivants sur la page : +#### Onglets synchronisés + +Conservez plusieurs groupes d'onglets synchronisés en ajoutant l'attribut `syncKey`. + +Tous les composants `` sur une page avec la même valeur `syncKey` afficheront le même label actif. +Cela permet à votre lecteur de choisir une fois (par exemple, leur système d'exploitation ou leur gestionnaire de paquets) et de voir leur choix reflété sur l'ensemble de la page. + +Pour synchroniser des onglets liés, ajoutez une propriété `syncKey` identique à chaque composant `` et assurez-vous qu'ils utilisent tous les mêmes libellés de `` : + +```mdx 'syncKey="constellations"' +# src/content/docs/exemple.mdx + +import { Tabs, TabItem } from '@astrojs/starlight/components'; + +_Quelques étoiles :_ + + + Bellatrix, Rigel, Bételgeuse + Pollux, Castor A, Castor B + + +_Quelques exoplanètes :_ + + + HD 34445 b, Gliese 179 b, Wasp-82 b + Pollux b, HAT-P-24b, HD 50554 b + +``` + +Le code ci-dessus génère les onglets suivants sur la page : + +_Quelques étoiles :_ + + + Bellatrix, Rigel, Bételgeuse + Pollux, Castor A, Castor B + + +_Quelques exoplanètes :_ + + + HD 34445 b, Gliese 179 b, Wasp-82 b + Pollux b, HAT-P-24b, HD 50554 b + + ### Cartes import { Card, CardGrid } from '@astrojs/starlight/components'; diff --git a/docs/src/content/docs/fr/guides/css-and-tailwind.mdx b/docs/src/content/docs/fr/guides/css-and-tailwind.mdx index 2a2da0fd59a..63f34201198 100644 --- a/docs/src/content/docs/fr/guides/css-and-tailwind.mdx +++ b/docs/src/content/docs/fr/guides/css-and-tailwind.mdx @@ -63,7 +63,7 @@ Le module d'extension Tailwind de Starlight applique la configuration suivante : Démarrez un nouveau projet Starlight avec Tailwind CSS préconfiguré en utilisant `create astro` : - + ```sh @@ -95,7 +95,7 @@ Si vous avez déjà un site Starlight et que vous souhaitez ajouter Tailwind CSS 1. Ajoutez l'intégration Astro pour Tailwind : - + @@ -125,7 +125,7 @@ Si vous avez déjà un site Starlight et que vous souhaitez ajouter Tailwind CSS 2. Installez le module d'extension Tailwind de Starlight : - + diff --git a/docs/src/content/docs/fr/guides/customization.mdx b/docs/src/content/docs/fr/guides/customization.mdx index efaab45ae40..f9cd3ced786 100644 --- a/docs/src/content/docs/fr/guides/customization.mdx +++ b/docs/src/content/docs/fr/guides/customization.mdx @@ -130,7 +130,7 @@ Vous pouvez personnaliser - ou même désactiver - la table des matières global Par défaut, les titres `

` et `

` sont inclus dans la table des matières. Modifiez les niveaux de titres à inclure à l’échelle du site à l’aide des options `minHeadingLevel` et `maxHeadingLevel` dans votre option de configuration [globale `tableOfContents`](/fr/reference/configuration/#tableofcontents). Remplacez ces valeurs par défaut sur une page individuelle en ajoutant les propriétés [frontmatter `tableOfContents`](/fr/reference/frontmatter/#tableofcontents) correspondantes : - + ```md {4-6} @@ -164,7 +164,7 @@ defineConfig({ Désactivez la table des matières complètement en définissant l’option `tableOfContents` à `false`: - + ```md {4} diff --git a/docs/src/content/docs/fr/guides/i18n.mdx b/docs/src/content/docs/fr/guides/i18n.mdx index a1592cdc195..e02ef168b09 100644 --- a/docs/src/content/docs/fr/guides/i18n.mdx +++ b/docs/src/content/docs/fr/guides/i18n.mdx @@ -143,6 +143,34 @@ Starlight s'attend à ce que vous créiez des pages équivalentes dans toutes vo Si une traduction n'est pas encore disponible pour une langue, Starlight affichera aux lecteurs le contenu de cette page dans la langue par défaut (définie via `defaultLocale`). Par exemple, si vous n'avez pas encore créé de version française de votre page À propos et que votre langue par défaut est l'anglais, les visiteurs de `/fr/about` verront le contenu anglais de `/en/about` avec un avis indiquant que cette page n'a pas encore été traduite. Cela vous permet d'ajouter du contenu dans votre langue par défaut et de le traduire progressivement lorsque vos traducteurs en ont le temps. +## Traduire le titre du site + +Par défaut, Starlight utilisera le même titre de site pour toutes les langues. +Si vous avez besoin de personnaliser le titre pour chaque langue, vous pouvez passer un objet à [`title`](/fr/reference/configuration/#title-obligatoire) dans les options de Starlight : + +```diff lang="js" +// astro.config.mjs +import { defineConfig } from 'astro/config'; +import starlight from '@astrojs/starlight'; + +export default defineConfig({ + integrations: [ + starlight({ +- title: 'Ma documentation', ++ title: { ++ fr: 'Ma documentation', ++ 'zh-CN': '我的文档', ++ }, + defaultLocale: 'fr', + locales: { + fr: { label: 'Français' }, + 'zh-cn': { label: '简体中文', lang: 'zh-CN' }, + }, + }), + ], +}); +``` + ## Traduire l'interface utilisateur de Starlight import LanguagesList from '~/components/languages-list.astro'; diff --git a/docs/src/content/docs/fr/reference/configuration.mdx b/docs/src/content/docs/fr/reference/configuration.mdx index 35e689c23bd..25a44952762 100644 --- a/docs/src/content/docs/fr/reference/configuration.mdx +++ b/docs/src/content/docs/fr/reference/configuration.mdx @@ -25,10 +25,22 @@ Vous pouvez passer les options suivantes à l'intégration `starlight`. ### `title` (obligatoire) -**Type :** `string` +**Type :** `string | Record` Définissez le titre de votre site web. Il sera utilisé dans les métadonnées et dans le titre de l'onglet du navigateur. +La valeur peut être une chaîne de caractères, ou pour les sites multilingues, un objet avec des valeurs pour chacune des différentes locales. +Lorsque vous utilisez la forme objet, les clés doivent être des étiquettes d'identification BCP-47 (par exemple `fr`, `ar`, ou `zh-CN`) : + +```ts +starlight({ + title: { + fr: 'Mon délicieux site de docs', + de: 'Meine bezaubernde Dokumentationsseite', + }, +}); +``` + ### `description` **Type :** `string` diff --git a/docs/src/content/docs/fr/reference/frontmatter.md b/docs/src/content/docs/fr/reference/frontmatter.md index 5f8e55b0fa5..be462d60d85 100644 --- a/docs/src/content/docs/fr/reference/frontmatter.md +++ b/docs/src/content/docs/fr/reference/frontmatter.md @@ -268,6 +268,21 @@ pagefind: false --- ``` +### `draft` + +**Type :** `boolean` +**Par défaut :** `false` + +Définit si cette page doit être considérée comme une ébauche et ne pas être incluse dans les [déploiements en production](https://docs.astro.build/fr/reference/cli-reference/#astro-build) et les [groupes de liens générés automatiquement](/fr/guides/sidebar/#groupes-générés-automatiquement). Définissez la valeur à `true` pour marquer une page comme une ébauche et la rendre visible uniquement pendant le développement. + +```md +--- +# src/content/docs/exemple.md +# Exclure cette page des déploiements en production +draft: true +--- +``` + ### `sidebar` **Type :** [`SidebarConfig`](#sidebarconfig) diff --git a/docs/src/content/docs/ko/getting-started.mdx b/docs/src/content/docs/ko/getting-started.mdx index 1a6f9c92e98..69a93162722 100644 --- a/docs/src/content/docs/ko/getting-started.mdx +++ b/docs/src/content/docs/ko/getting-started.mdx @@ -17,7 +17,7 @@ Starlight는 [Astro](https://astro.build) 프레임워크 위에 구축되었으 터미널에서 다음 명령을 실행하여 새 Astro + Starlight 프로젝트를 생성합니다. - + ```sh @@ -54,7 +54,7 @@ yarn create astro --template starlight 프로젝트 디렉터리에서 다음 명령을 실행하여 개발 서버를 시작합니다. - + ```sh @@ -105,7 +105,7 @@ Starlight는 베타 소프트웨어이기 때문에 업데이트와 개선이 Starlight는 Astro 통합입니다. 터미널에서 다음 명령을 실행하여 이 패키지와 다른 Astro 패키지를 업데이트할 수 있습니다. - + ```sh diff --git a/docs/src/content/docs/ko/guides/components.mdx b/docs/src/content/docs/ko/guides/components.mdx index f91d3eee073..9b74fa18792 100644 --- a/docs/src/content/docs/ko/guides/components.mdx +++ b/docs/src/content/docs/ko/guides/components.mdx @@ -87,6 +87,50 @@ import { Tabs, TabItem } from '@astrojs/starlight/components'; +#### 동기화된 탭 + +`syncKey` 속성을 추가하여 여러 탭 그룹을 동기화된 상태로 유지합니다. + +동일한 `syncKey` 값을 가진 페이지의 모든 ``에는 동일한 활성 라벨이 표시됩니다. 이를 통해 독자는 한 번 (예: 운영 체제 또는 패키지 관리자) 선택하고 선택 사항이 페이지 전체에 반영되는 것을 볼 수 있습니다. + +관련 탭을 동기화하려면 각 `` 컴포넌트에 동일한 `syncKey` 속성을 추가하고 모두 동일한 `` 라벨을 사용하는지 확인하세요. + +```mdx 'syncKey="별자리"' +# src/content/docs/example.mdx + +import { Tabs, TabItem } from '@astrojs/starlight/components'; + +_별:_ + + + 벨라트릭스, 리겔, 베텔게우스 + 폴룩스, 캐스터 A, 캐스터 B + + +_외계 행성:_ + + + HD 34445 b, 글리제 179 b, Wasp-82 b + 폴룩스 b, HAT-P-24b, HD 50554 b + +``` + +위 코드는 페이지에 다음을 생성합니다. + +_별:_ + + + 벨라트릭스, 리겔, 베텔게우스 + 폴룩스, 캐스터 A, 캐스터 B + + +_외계 행성:_ + + + HD 34445 b, 글리제 179 b, Wasp-82 b + 폴룩스 b, HAT-P-24b, HD 50554 b + + ### 카드 import { Card, CardGrid } from '@astrojs/starlight/components'; diff --git a/docs/src/content/docs/ko/guides/css-and-tailwind.mdx b/docs/src/content/docs/ko/guides/css-and-tailwind.mdx index 89f26ed7f51..7cf43716819 100644 --- a/docs/src/content/docs/ko/guides/css-and-tailwind.mdx +++ b/docs/src/content/docs/ko/guides/css-and-tailwind.mdx @@ -62,7 +62,7 @@ Starlight Tailwind 플러그인은 다음 구성을 적용합니다. `create astro`를 사용하여 Tailwind CSS가 사전 구성된 새 Starlight 프로젝트를 시작하세요. - + ```sh @@ -94,7 +94,7 @@ yarn create astro --template starlight/tailwind 1. Astro의 Tailwind 통합 추가 - + @@ -124,7 +124,7 @@ yarn create astro --template starlight/tailwind 2. Starlight Tailwind 플러그인을 설치하세요. - + diff --git a/docs/src/content/docs/ko/guides/customization.mdx b/docs/src/content/docs/ko/guides/customization.mdx index 2778adaeb99..37c03eda14d 100644 --- a/docs/src/content/docs/ko/guides/customization.mdx +++ b/docs/src/content/docs/ko/guides/customization.mdx @@ -125,7 +125,7 @@ Starlight는 독자가 원하는 제목으로 쉽게 이동할 수 있도록 각 기본적으로 `

` 및 `

` 제목이 목차에 포함됩니다. [`tableOfContents`](/ko/reference/configuration/#tableofcontents) 의 `minHeadingLevel` 및 `maxHeadingLevel` 옵션을 사용하여 모든 페이지의 목차를 변경할 수 있습니다. 개별 페이지의 기본 목차를 변경하기 위해서는 [프론트매터에 `tableOfContents`](/ko/reference/frontmatter/#tableofcontents) 속성을 추가하세요. - + ```md {4-6} @@ -159,7 +159,7 @@ defineConfig({ `tableOfContents` 옵션의 값을 `false`로 설정하여 모든 페이지의 목차를 비활성화 할 수 있습니다. - + ```md {4} diff --git a/docs/src/content/docs/ko/guides/i18n.mdx b/docs/src/content/docs/ko/guides/i18n.mdx index a1380be1344..0a962dd4591 100644 --- a/docs/src/content/docs/ko/guides/i18n.mdx +++ b/docs/src/content/docs/ko/guides/i18n.mdx @@ -143,6 +143,34 @@ Starlight는 귀하가 모든 언어로 같은 페이지를 생성할 것을 기 특정 언어에 대한 번역이 아직 제공되지 않는 경우 Starlight는 독자에게 해당 페이지의 콘텐츠를 기본 언어(`defaultLocale`을 통해 설정된 언어)로 표시합니다. 예를 들어, About 페이지의 프랑스어 버전을 아직 만들지 않았고 기본 언어가 영어인 경우 `/fr/about`에 방문한 독자는 이 페이지가 아직 번역되지 않았다는 알림과 함께 `/en/about`에 있는 영어 콘텐츠를 보게 됩니다. 이를 통해 기본 언어로 콘텐츠를 추가한 다음 점진적으로 번역할 수 있습니다. +## 사이트 제목 번역 + +기본적으로 Starlight는 모든 언어에 대해 동일한 사이트 제목을 사용합니다. +각 로케일의 제목을 사용자 정의해야 하는 경우 Starlight 옵션의 [`title`](/ko/reference/configuration/#title-필수)에 객체를 전달할 수 있습니다. + +```diff lang="js" +// astro.config.mjs +import { defineConfig } from 'astro/config'; +import starlight from '@astrojs/starlight'; + +export default defineConfig({ + integrations: [ + starlight({ +- title: '나의 문서', ++ title: { ++ ko: '나의 문서', ++ 'zh-CN': '我的文档', ++ }, + defaultLocale: 'ko', + locales: { + ko: { label: '한국어' }, + 'zh-cn': { label: '简体中文', lang: 'zh-CN' }, + }, + }), + ], +}); +``` + ## Starlight UI 번역 import LanguagesList from '~/components/languages-list.astro'; diff --git a/docs/src/content/docs/ko/guides/pages.mdx b/docs/src/content/docs/ko/guides/pages.mdx index 751329755ec..77f0cb16ea0 100644 --- a/docs/src/content/docs/ko/guides/pages.mdx +++ b/docs/src/content/docs/ko/guides/pages.mdx @@ -105,6 +105,7 @@ Markdown 페이지의 프론트매터와 유사하게 이 페이지에 대한 [ - [`slug`](/ko/reference/frontmatter/#slug) 속성은 지원되지 않으며 사용자 정의 페이지의 URL을 기반으로 자동 설정됩니다. - [`editUrl`](/ko/reference/frontmatter/#editurl) 옵션에는 편집 링크를 표시하기 위한 URL이 필요합니다. - [자동 생성된 링크 그룹](/ko/reference/configuration/#sidebar)에서 페이지가 표시되는 방식을 사용자 정의하기 위한 [`sidebar`](/ko/reference/frontmatter/#sidebar) 프론트매터 속성을 사용할 수 없습니다. `` 컴포넌트를 사용하는 페이지는 컬렉션의 일부가 아니며 자동 생성된 사이드바 그룹에 추가될 수 없습니다. +- [`draft`](/ko/reference/frontmatter/#draft) 옵션은 페이지가 초안이라는 [알림](/ko/reference/overrides/#draftcontentnotice)만 표시할 뿐 프로덕션 빌드에서 자동으로 제외하지는 않습니다. ##### `sidebar` diff --git a/docs/src/content/docs/ko/reference/configuration.mdx b/docs/src/content/docs/ko/reference/configuration.mdx index dccbd689f4b..f8da089fb31 100644 --- a/docs/src/content/docs/ko/reference/configuration.mdx +++ b/docs/src/content/docs/ko/reference/configuration.mdx @@ -25,10 +25,22 @@ export default defineConfig({ ### `title` (필수) -**타입:** `string` +**타입:** `string | Record` 웹사이트의 제목을 설정합니다. 메타데이터 및 브라우저 탭 제목에 사용됩니다. +값은 문자열일 수도 있고, 다국어 사이트의 경우 각기 다른 로케일에 대한 값이 포함된 객체일 수도 있습니다. +객체 형식을 사용할 때 키는 BCP-47 태그(예: `en`, `ar` 또는 `zh-CN`)여야 합니다. + +```ts +starlight({ + title: { + en: 'My delightful docs site', + de: 'Meine bezaubernde Dokumentationsseite', + }, +}); +``` + ### `description` **타입:** `string` diff --git a/docs/src/content/docs/ko/reference/frontmatter.md b/docs/src/content/docs/ko/reference/frontmatter.md index 7ff21f61e3c..58081889fda 100644 --- a/docs/src/content/docs/ko/reference/frontmatter.md +++ b/docs/src/content/docs/ko/reference/frontmatter.md @@ -266,6 +266,21 @@ pagefind: false --- ``` +### `draft` + +**타입:** `boolean` +**기본값:** `false` + +이 페이지를 초안으로 간주하여 [프로덕션 빌드](https://docs.astro.build/ko/reference/cli-reference/#astro-build) 및 [자동 생성된 링크 그룹](/ko/guides/sidebar/#자동-생성-그룹)에 포함하지 않을지 여부를 설정합니다. 페이지를 초안으로 표시하고 개발 중에만 표시하려면 `true`로 설정하세요. + +```md +--- +# src/content/docs/example.md +# 프로덕션 빌드에서 이 페이지 제외 +draft: true +--- +``` + ### `sidebar` **타입:** [`SidebarConfig`](#sidebarconfig) diff --git a/docs/src/content/docs/ko/reference/overrides.md b/docs/src/content/docs/ko/reference/overrides.md index 8d882f22406..33698ac645b 100644 --- a/docs/src/content/docs/ko/reference/overrides.md +++ b/docs/src/content/docs/ko/reference/overrides.md @@ -50,6 +50,12 @@ Starlight는 사용자 정의 컴포넌트에 다음 속성들을 전달합니 언어가 제공되는 기본 경로입니다. 루트 로케일 슬러그의 경우 `undefined`입니다. +#### `siteTitle` + +**타입:** `string` + +이 페이지의 로케일에 대한 사이트 제목입니다. + #### `slug` **타입:** `string` @@ -217,7 +223,7 @@ Starlight의 상단 탐색 바를 렌더링하는 컴포넌트입니다. **기본 컴포넌트:** [`Header.astro`](https://github.com/withastro/starlight/blob/main/packages/starlight/components/Header.astro) Header 컴포넌트는 모든 페이지 상단에 표시됩니다. -기본적으로 [``](#sitetitle), [``](#search), [``](#socialicons), [``](#themeselect), 와 [``](#languageselect)를 표시합니다. +기본적으로 [``](#sitetitle-1), [``](#search), [``](#socialicons), [``](#themeselect), 와 [``](#languageselect)를 표시합니다. #### `SiteTitle` @@ -329,6 +335,12 @@ Starlight의 페이지 사이드바는 현재 페이지의 하위 제목을 간 현재 페이지의 `

` 요소를 포함하는 컴포넌트입니다. 기본 구현과 같이 `

` 요소에 `id="_top"`을 설정해야 합니다. +#### `DraftContentNotice` + +**기본 컴포넌트:** [`DraftContentNotice.astro`](https://github.com/withastro/starlight/blob/main/packages/starlight/components/DraftContentNotice.astro) + +현재 페이지가 초안으로 표시되면 개발 중에 사용자에게 표시되는 알림입니다. + #### `FallbackContentNotice` **기본 컴포넌트:** [`FallbackContentNotice.astro`](https://github.com/withastro/starlight/blob/main/packages/starlight/components/FallbackContentNotice.astro) diff --git a/docs/src/content/docs/pt-br/getting-started.mdx b/docs/src/content/docs/pt-br/getting-started.mdx index 1b708f8e3a2..00cf8aa04dc 100644 --- a/docs/src/content/docs/pt-br/getting-started.mdx +++ b/docs/src/content/docs/pt-br/getting-started.mdx @@ -15,7 +15,7 @@ Consulte as [instruções de instalação manual](/pt-br/manual-setup/) para adi Crie um novo projeto Astro + Starlight executando o seguinte comando em seu terminal: - + ```sh @@ -52,7 +52,7 @@ Quando estiver trabalhando localmente, o [servidor de desenvolvimento do Astro]( Dentro do diretório do seu projeto, execute o seguinte comando para iniciar o servidor de desenvolvimento: - + ```sh @@ -103,7 +103,7 @@ Certifique-se de atualizar Starlight constantemente! Starlight é uma integração Astro. Você pode atualiza-lo e outros pacotes Astro com o seguinte comando em seu terminal: - + ```sh diff --git a/docs/src/content/docs/tr/getting-started.mdx b/docs/src/content/docs/tr/getting-started.mdx index f456c43139d..30bc892066a 100644 --- a/docs/src/content/docs/tr/getting-started.mdx +++ b/docs/src/content/docs/tr/getting-started.mdx @@ -1,21 +1,24 @@ --- title: Başlarken -description: Sıradaki dokümantasyon site Astro'nun Starlight'ı ile nasıl oluşturacağını öğren. +description: Sıradaki dokümantasyon siteni Astro'nun Starlight'ı ile nasıl oluşturacağını öğren. --- import { Tabs, TabItem } from '@astrojs/starlight/components'; -## Yeni Proje Oluşturma +Starlight, [Astro](https://astro.build) çerçevesi üstüne kurulmuş çok özellikli bir dokümantasyon temasıdır. +Bu rehber, yeni projeye başlamanda yardımcı olacak. +Mevcut Astro projesine Starlight eklemek için [elle kurulum talimatlarını](/tr/manual-setup/) incele. -Starlight, Astro çerçevesi üstüne kurulmuş çok özellikli bir dokümantasyon temasıdır. +## Hızlı Başlangıç -Aşağıdaki komutları kullanarak yeni bir Astro + Starlight projesi oluşturabilirsin: +### Yeni Proje Oluşturma - +Aşağıdaki komutu terminalinde çalıştırarak yeni bir Astro + Starlight projesi oluştur: + + ```sh -# npm ile yeni bir proje oluştur npm create astro@latest -- --template starlight ``` @@ -23,7 +26,6 @@ npm create astro@latest -- --template starlight ```sh -# pnpm ile yeni bir proje oluştur pnpm create astro --template starlight ``` @@ -31,7 +33,6 @@ pnpm create astro --template starlight ```sh -# yarn ile yeni bir proje oluştur yarn create astro --template starlight ``` @@ -45,72 +46,82 @@ Starlight'ı tarayıcında dene: [StackBlitz'deki taslağı aç](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics). ::: -## Starlight ile İçerik Oluşturmak +### Geliştirme sunucusunu başlat -Starlight, yeni bir içerik eklemen ya da var olan dosyalarını getirmen için hazır! +[Astro’nun geliştirme sunucusu](https://docs.astro.build/en/reference/cli-reference/#astro-dev) lokalinizde çalışırken, çalışmanızı önizlemeye ve otomatik olarak tarayıcınızın değişiklik yaptığınızda yenilenmesine olanak tanır. -### Dosya Formatları +Geliştirme sunucusunu başlatmak için aşağıdaki komutu proje dizininizde çalıştırın: -Starlight, içerik yazmada Markdown ve MDX formatlarını destekler. (Deneysel [Astro Markdoc entegrasyonu](https://docs.astro.build/en/guides/integrations-guide/markdoc/)'nu yükleyerek Markdoc formatı için destek ekleyebilirsin.) + + -### Sayfa Ekle +```sh +npm run dev +``` -`src/content/docs/` dizini altında `.md` or `.mdx` uzantılı dosya ekleyerek otomatik olarak sitene yeni sayfalar ekle. Dosyalarını organize etmek ve çoklu dizim bölümleri oluşturmak için yeni alt klasörler ekle: + + +```sh +pnpm dev ``` -src/content/docs/hello-world.md => your-site.com/hello-world -src/content/docs/guides/faq.md => your-site.com/guides/faq + + + + +```sh +yarn dev ``` -### Tip-korumalı Ön BÖlüm + + + +Bu, terminalinizde lokal önizleme bağlantılı bir mesaj gösterecektir. +Sitenizi tarayıcıda görüntülemek için bu bağlantıyı açın. -Tüm Starlight sayfaları özelleştirilebilir [ortak ön-bölüm mülkleri seti](/tr/reference/frontmatter/)'ni, sayfaların nasıl görüntüleneceğini kontrol etmek için paylaşır: +### İçerik Ekle -```md ---- -title: Merhaba, Dünya! -description: Bu, Starlight'la hazırlanmış sitemdeki bir sayfadır. ---- -``` +Starlight, yeni bir içerik eklemen ya da var olan dosyalarını getirmen için hazır! -Herhangi önemli bir şeyi unutursan, Starlight sana hatırlatacaktır. +`src/content/docs/` dizini içerisinde yeni Markdown dosyaları oluşturarak yeni sayfalar ekleyin. -## Starlight Web Siteni Yayına Al +Dosya bazlı gezinim ve MDX ile Markdoc dosya desteği hakkında daha fazlası için [“Sayfalar”](/tr/guides/pages/) rehberini okuyun. -Starlight websiteni oluşturduktan ve özelleştirdikten sonra; bir web sunucusunda ya da Netlify, Vercel, GitHub Pages ve daha fazla barındırma platformundan herhangi birinde yayına alabilirsin. +### Sonraki Adımlar -[Astro dokümantasyonunda, bir Astro sitenin nasıl yayına alındığını öğren.](https://docs.astro.build/en/guides/deploy/) +- **Yapılandır:** [“Starlight'ı özelleştirmek”](/tr/guides/customization/) rehberinde ortak ayarlar hakkında öğren. +- **Gezinme:** [“Kenar Çubuğu Gezinimi”](/tr/guides/sidebar/) rehberi ile kenar çubuğunu ayarla. +- **Bileşenler:** [“Bileşenler”](/tr/guides/components/) rehberinde hazır yapılmış kartlar, tablar ve daha fazlasını keşfet. +- **Yayına al:** Astro dokümantayonu içerisindeki [“Siteni yayına al”](https://docs.astro.build/en/guides/deploy/) rehberi ile çalışmanı yayınla. ## Starlight'ı Güncelleme :::tip -Starlight, beta sürümünde olduğundan dolayı sıklıkla güncelleme ve geliştirmeler yapılacak. Starlight'ı güncel tuttuğuna emin ol! +Starlight, beta sürümünde olduğundan dolayı sıklıkla güncelleme ve geliştirmeler yapılacak. +Starlight'ı güncel tuttuğuna emin ol! ::: -Starlight bir Astro entegrasyonudur ve herhangi bir `@astrojs/*` entegrasyonu gibi güncellenir: +Starlight bir Astro entegrasyonudur. Bunu ve diğer Astro paketlerini, terminalinde aşağıdaki komutu çalıştırarak güncelleyebilirsin: - + ```sh -# npm ile Starlight'ı güncelle -npm install @astrojs/starlight@latest +npx @astrojs/upgrade ``` ```sh -# pnpm ile Starlight'ı güncelle -pnpm upgrade @astrojs/starlight --latest +pnpm dlx @astrojs/upgrade ``` ```sh -# yarn ile Starlight'ı güncelle -yarn upgrade @astrojs/starlight --latest +yarn dlx @astrojs/upgrade ``` diff --git a/examples/basics/package.json b/examples/basics/package.json index 2899cd2d223..9b318cea5ef 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "@astrojs/starlight": "^0.22.0", + "@astrojs/starlight": "^0.22.1", "astro": "^4.3.5", "sharp": "^0.32.5" } diff --git a/examples/tailwind/package.json b/examples/tailwind/package.json index 7d7e5d229f9..cad21e9cb7d 100644 --- a/examples/tailwind/package.json +++ b/examples/tailwind/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "@astrojs/starlight": "^0.22.0", + "@astrojs/starlight": "^0.22.1", "@astrojs/starlight-tailwind": "^2.0.2", "@astrojs/tailwind": "^5.1.0", "astro": "^4.3.5", diff --git a/packages/starlight/CHANGELOG.md b/packages/starlight/CHANGELOG.md index a61d9f9a07f..679eff5ed28 100644 --- a/packages/starlight/CHANGELOG.md +++ b/packages/starlight/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/starlight +## 0.22.1 + +### Patch Changes + +- [`1c0fc384`](https://github.com/withastro/starlight/commit/1c0fc3849771713d5a3e7a572bdbf1483ae5551b) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fixes an issue where the `siteTitle` property would not be set when using the `` component. + ## 0.22.0 ### Minor Changes diff --git a/packages/starlight/__tests__/basics/starlight-page-route-data.test.ts b/packages/starlight/__tests__/basics/starlight-page-route-data.test.ts index 95f611e255c..e5164e04108 100644 --- a/packages/starlight/__tests__/basics/starlight-page-route-data.test.ts +++ b/packages/starlight/__tests__/basics/starlight-page-route-data.test.ts @@ -1,4 +1,6 @@ import { assert, expect, test, vi } from 'vitest'; +import { generateRouteData } from '../../utils/route-data'; +import { routes } from '../../utils/routing'; import { generateStarlightPageRouteData, type StarlightPageProps, @@ -46,6 +48,7 @@ test('adds data to route shape', async () => { // Starlight pages respect the passed data. expect(data.entry.data.title).toBe(starlightPageProps.frontmatter.title); // Starlight pages get expected defaults. + expect(data.siteTitle).toBe('Basics'); expect(data.hasSidebar).toBe(true); expect(data.headings).toEqual([]); expect(data.entryMeta.dir).toBe('ltr'); @@ -494,3 +497,18 @@ test('strips unknown frontmatter properties', async () => { }); expect('unknown' in data.entry.data).toBe(false); }); + +test('generates data with a similar root shape to regular route data', async () => { + const route = routes[0]!; + const data = generateRouteData({ + props: { ...route, headings: [{ depth: 1, slug: 'heading-1', text: 'Heading 1' }] }, + url: new URL('https://example.com'), + }); + + const starlightPageData = await generateStarlightPageRouteData({ + props: starlightPageProps, + url: starlightPageUrl, + }); + + expect(Object.keys(data).sort()).toEqual(Object.keys(starlightPageData).sort()); +}); diff --git a/packages/starlight/package.json b/packages/starlight/package.json index e0ebde3ad2a..059b2ba8acc 100644 --- a/packages/starlight/package.json +++ b/packages/starlight/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/starlight", - "version": "0.22.0", + "version": "0.22.1", "description": "Build beautiful, high-performance documentation websites with Astro", "scripts": { "test": "vitest", diff --git a/packages/starlight/utils/route-data.ts b/packages/starlight/utils/route-data.ts index f9c6717de98..a47e68f262f 100644 --- a/packages/starlight/utils/route-data.ts +++ b/packages/starlight/utils/route-data.ts @@ -111,7 +111,7 @@ function getEditUrl({ entry, id, isFallback }: PageProps): URL | undefined { } /** Get the site title for a given language. **/ -function getSiteTitle(lang: string): string { +export function getSiteTitle(lang: string): string { const defaultLang = config.defaultLocale.lang as string; if (lang && config.title[lang]) { return config.title[lang] as string; diff --git a/packages/starlight/utils/starlight-page.ts b/packages/starlight/utils/starlight-page.ts index 88fbef872cc..e736457bbb5 100644 --- a/packages/starlight/utils/starlight-page.ts +++ b/packages/starlight/utils/starlight-page.ts @@ -3,7 +3,7 @@ import { type ContentConfig, type SchemaContext } from 'astro:content'; import config from 'virtual:starlight/user-config'; import { parseWithFriendlyErrors } from './error-map'; import { stripLeadingAndTrailingSlashes } from './path'; -import { getToC, type PageProps, type StarlightRouteData } from './route-data'; +import { getSiteTitle, getToC, type PageProps, type StarlightRouteData } from './route-data'; import type { StarlightDocsEntry } from './routing'; import { slugToLocaleData, urlToSlug } from './slugs'; import { getPrevNextLinks, getSidebar } from './navigation'; @@ -223,6 +223,7 @@ export async function generateStarlightPageRouteData({ lastUpdated, pagination: getPrevNextLinks(sidebar, config.pagination, entry.data), sidebar, + siteTitle: getSiteTitle(localeData.lang), slug, toc: getToC({ ...routeProps, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cd2e1ce9573..1094b3f4ba5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -67,7 +67,7 @@ importers: examples/basics: dependencies: '@astrojs/starlight': - specifier: ^0.22.0 + specifier: ^0.22.1 version: link:../../packages/starlight astro: specifier: ^4.3.5 @@ -79,7 +79,7 @@ importers: examples/tailwind: dependencies: '@astrojs/starlight': - specifier: ^0.22.0 + specifier: ^0.22.1 version: link:../../packages/starlight '@astrojs/starlight-tailwind': specifier: ^2.0.2