diff --git a/.changeset/cool-moons-thank.md b/.changeset/cool-moons-thank.md
new file mode 100644
index 00000000000..ec20b8780d5
--- /dev/null
+++ b/.changeset/cool-moons-thank.md
@@ -0,0 +1,5 @@
+---
+'@astrojs/starlight': patch
+---
+
+Prevent Starlight crashing when the content folder doesn't exist, or is empty
diff --git a/.changeset/fair-trains-care.md b/.changeset/fair-trains-care.md
new file mode 100644
index 00000000000..e4485429058
--- /dev/null
+++ b/.changeset/fair-trains-care.md
@@ -0,0 +1,5 @@
+---
+"@astrojs/starlight": patch
+---
+
+Fix content collection schema compatibility with Astro 3.1 and higher
diff --git a/.changeset/few-roses-explain.md b/.changeset/few-roses-explain.md
new file mode 100644
index 00000000000..e55f0066653
--- /dev/null
+++ b/.changeset/few-roses-explain.md
@@ -0,0 +1,5 @@
+---
+"@astrojs/starlight": patch
+---
+
+Fix Dutch UI translation for “Previous page” links
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
new file mode 100644
index 00000000000..ff6d2f20acf
--- /dev/null
+++ b/.git-blame-ignore-revs
@@ -0,0 +1,5 @@
+# Apply with:
+# `git config --local blame.ignoreRevsFile .git-blame-ignore-revs`
+
+# [Add Prettier and format files](https://github.com/withastro/starlight/pull/393)
+9b172f5ee09697d80f301e9b70aca1946419ce24
diff --git a/.npmrc b/.npmrc
index f4c92139cfd..901b4e86a04 100644
--- a/.npmrc
+++ b/.npmrc
@@ -1,2 +1,3 @@
prefer-workspace-packages=true
link-workspace-packages=true
+shell-emulator=true
diff --git a/docs/README.md b/docs/README.md
index a9b789022ab..7a0d9a67360 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1,5 +1,7 @@
# Starlight Docs
+[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)
+
This directory contains the Starlight documentation website (built with Starlight!)
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/docs)
diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs
index dec5bb76c25..72141ee858b 100644
--- a/docs/astro.config.mjs
+++ b/docs/astro.config.mjs
@@ -8,6 +8,7 @@ export const locales = {
ja: { label: '日本語', lang: 'ja' },
fr: { label: 'Français', lang: 'fr' },
it: { label: 'Italiano', lang: 'it' },
+ id: { label: 'Bahasa Indonesia', lang: 'id' },
zh: { label: '简体中文', lang: 'zh' },
'pt-br': { label: 'Português do Brasil', lang: 'pt-BR' },
ko: { label: '한국어', lang: 'ko' },
@@ -61,6 +62,7 @@ export default defineConfig({
ja: 'ここからはじめる',
fr: 'Commencez ici',
it: 'Inizia qui',
+ id: 'Mulai dari sini',
zh: '从这里开始',
'pt-BR': 'Comece Aqui',
ko: '여기서부터',
@@ -75,6 +77,7 @@ export default defineConfig({
ja: '入門',
fr: 'Mise en route',
it: 'Iniziamo',
+ id: 'Memulai',
zh: '开始使用',
'pt-BR': 'Introdução',
ko: '시작하기',
@@ -89,6 +92,7 @@ export default defineConfig({
ja: '手動セットアップ',
fr: 'Installation manuelle',
// it: 'Manual Setup',
+ id: 'Instalasi Manual',
zh: '手动配置',
'pt-BR': 'Instalação Manual',
ko: '수동으로 설정하기',
@@ -103,6 +107,7 @@ export default defineConfig({
ja: '環境への負荷',
fr: 'Impact environnemental',
it: 'Impatto ambientale',
+ id: 'Dampak terhadap lingkungan',
zh: '环境影响',
'pt-BR': 'Impacto Ambiental',
ko: '환경적 영향',
@@ -117,6 +122,7 @@ export default defineConfig({
ja: 'ショーケース',
fr: 'Vitrine',
// it: '',
+ id: 'Galeri',
ko: '쇼케이스',
},
},
@@ -130,6 +136,7 @@ export default defineConfig({
ja: 'ガイド',
fr: 'Guides',
it: 'Guide',
+ id: 'Petunjuk Penggunaan',
zh: '指南',
'pt-BR': 'Guias',
ko: '가이드',
@@ -144,6 +151,7 @@ export default defineConfig({
ja: 'リファレンス',
fr: 'Référence',
it: 'Riferimenti',
+ id: 'Referensi',
zh: '参考',
'pt-BR': 'Referência',
ko: '참조',
@@ -154,5 +162,4 @@ export default defineConfig({
lastUpdated: true,
}),
],
- image: { service: { entrypoint: 'astro/assets/services/sharp' } },
});
diff --git a/docs/package.json b/docs/package.json
index c63dcfd4234..8f37406e084 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -4,8 +4,8 @@
"type": "module",
"version": "0.0.1",
"scripts": {
- "test": "start-server-and-test preview http://localhost:4321 pa11y",
- "pa11y": "pa11y-ci --sitemap 'http://localhost:4321/sitemap-index.xml' --sitemap-find 'https://starlight.astro.build' --sitemap-replace 'http://localhost:4321' --sitemap-exclude '/(de|zh|fr|es|pt-br|it|ko)/.*'",
+ "test": "start-server-and-test 'pnpm preview' http://localhost:4321 'pnpm pa11y'",
+ "pa11y": "pa11y-ci --sitemap 'http://localhost:4321/sitemap-0.xml' --sitemap-find 'https://starlight.astro.build' --sitemap-replace 'http://localhost:4321' --sitemap-exclude '/(de|zh|fr|es|pt-br|it|ko)/.*'",
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
diff --git a/docs/src/assets/showcase/commandkit.underctrl.io.png b/docs/src/assets/showcase/commandkit.underctrl.io.png
deleted file mode 100644
index c3850b61beb..00000000000
Binary files a/docs/src/assets/showcase/commandkit.underctrl.io.png and /dev/null differ
diff --git a/docs/src/assets/showcase/dev.vrchatfrance.fr.png b/docs/src/assets/showcase/dev.vrchatfrance.fr.png
new file mode 100644
index 00000000000..55286154441
Binary files /dev/null and b/docs/src/assets/showcase/dev.vrchatfrance.fr.png differ
diff --git a/docs/src/assets/showcase/kanriapp.com.png b/docs/src/assets/showcase/kanriapp.com.png
new file mode 100644
index 00000000000..6e8dbb59c1d
Binary files /dev/null and b/docs/src/assets/showcase/kanriapp.com.png differ
diff --git a/docs/src/assets/showcase/refact.ai.png b/docs/src/assets/showcase/refact.ai.png
new file mode 100644
index 00000000000..ff74032ffec
Binary files /dev/null and b/docs/src/assets/showcase/refact.ai.png differ
diff --git a/docs/src/components/showcase-sites.astro b/docs/src/components/showcase-sites.astro
new file mode 100644
index 00000000000..4661828aae0
--- /dev/null
+++ b/docs/src/components/showcase-sites.astro
@@ -0,0 +1,56 @@
+---
+import Card from './showcase-card.astro';
+import FluidGrid from './fluid-grid.astro';
+---
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/src/components/sidebar-preview.astro b/docs/src/components/sidebar-preview.astro
new file mode 100644
index 00000000000..0865d2f6315
--- /dev/null
+++ b/docs/src/components/sidebar-preview.astro
@@ -0,0 +1,49 @@
+---
+import type { AutoSidebarGroup, SidebarItem } from '../../../packages/starlight/utils/user-config';
+import SidebarSublist from '../../../packages/starlight/components/SidebarSublist.astro';
+import type { SidebarEntry } from '../../../packages/starlight/utils/navigation';
+
+interface Props {
+ config: SidebarConfig;
+}
+
+type SidebarConfig = Exclude[];
+
+const { config } = Astro.props;
+
+function makeEntries(items: SidebarConfig): SidebarEntry[] {
+ return items.map((item) => {
+ if ('link' in item) {
+ return {
+ type: 'link',
+ label: item.label,
+ href: item.link,
+ isCurrent: false,
+ badge: item.badge,
+ };
+ }
+
+ item;
+
+ return {
+ type: 'group',
+ label: item.label,
+ entries: makeEntries(item.items as SidebarConfig),
+ collapsed: item.collapsed,
+ };
+ });
+}
+---
+
+
+
+
diff --git a/docs/src/content/docs/es/guides/customization.mdx b/docs/src/content/docs/es/guides/customization.mdx
index 9406df2970e..b1603164115 100644
--- a/docs/src/content/docs/es/guides/customization.mdx
+++ b/docs/src/content/docs/es/guides/customization.mdx
@@ -86,6 +86,19 @@ Puedes mostrar diferentes versiones de tu logo en modos claro y oscuro.
}),
```
+## Habilitar el mapa del sitio
+
+Starlight tiene soporte incorporado para generar un mapa del sitio. Habilita la generación del mapa del sitio estableciendo tu URL como `site` en `astro.config.mjs`:
+
+```js
+// astro.config.mjs
+
+export default defineConfig({
+ site: 'https://stargazers.club',
+ integrations: [starlight({ title: 'Sitio con mapa del sitio' })],
+});
+```
+
## Diseño de página
De forma predeterminada, las páginas de Starlight utilizan un diseño con una barra lateral de navegación global y una tabla de contenidos que muestra los encabezados de la página actual.
diff --git a/docs/src/content/docs/es/guides/i18n.mdx b/docs/src/content/docs/es/guides/i18n.mdx
index 2e7c07a1dc8..cce43098484 100644
--- a/docs/src/content/docs/es/guides/i18n.mdx
+++ b/docs/src/content/docs/es/guides/i18n.mdx
@@ -140,7 +140,7 @@ Si no hay una traducción disponible para un idioma, Starlight mostrará a los l
## Traduce la UI de Starlight
-Starlight proporciona de forma predeterminada traducciones para los textos utilizados en la UI al inglés, checo, francés, alemán, italiano, japonés, holandés, portugués, danés, español, turco, árabe, noruego, farsi, chino simplificado, coreano y sueco. También damos la bienvenida a [contribuciones para agregar más idiomas predeterminados](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md).
+Starlight proporciona de forma predeterminada traducciones para los textos utilizados en la UI al inglés, checo, francés, alemán, italiano, japonés, holandés, portugués, danés, español, turco, árabe, noruego, farsi, hebreo, chino simplificado, coreano, indonesio, ruso y sueco. También damos la bienvenida a [contribuciones para agregar más idiomas predeterminados](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md).
1. Configura la colección de datos `i18n` en `src/content/config.ts` si aún no está configurada:
diff --git a/docs/src/content/docs/es/guides/sidebar.mdx b/docs/src/content/docs/es/guides/sidebar.mdx
new file mode 100644
index 00000000000..23a398f0df0
--- /dev/null
+++ b/docs/src/content/docs/es/guides/sidebar.mdx
@@ -0,0 +1,487 @@
+---
+title: Barra Lateral de Navegación
+description: Aprende a configurar y personalizar los enlaces de navegación de la barra lateral de tu sitio Starlight.
+sidebar:
+ badge: Nuevo
+---
+
+import FileTree from '../../../../components/file-tree.astro';
+import SidebarPreview from '../../../../components/sidebar-preview.astro';
+
+Una barra lateral bien organizada es clave para una buena documentación, ya que es una de las principales formas en que los usuarios navegarán por su sitio. Starlight proporciona un conjunto completo de opciones para personalizar el diseño y el contenido de tu barra lateral.
+
+## Barra lateral predeterminada
+
+Por defecto, Starlight generará automáticamente una barra lateral basada en la estructura del sistema de archivos de tu documentación, utilizando la propiedad `title` de cada archivo como entrada de la barra lateral.
+
+Por ejemplo, dada la siguiente estructura de archivos:
+
+
+
+- src/
+ - content/
+ - docs/
+ - guides/
+ - components.md
+ - i18n.md
+ - reference/
+ - configuration.md
+
+
+
+La siguiente barra lateral se generará automáticamente:
+
+
+
+Aprende más sobre las barras laterales generadas automáticamente en la sección [grupos autogenerados](#grupos-autogenerados).
+
+## Agregar enlaces y grupos de enlaces
+
+Para configurar los [enlaces](#enlaces) de tu barra lateral y [grupos de enlaces](#grupos) (dentro de un encabezado plegable), usa la propiedad [`starlight.sidebar`](/es/reference/configuration/#sidebar) en `astro.config.mjs`.
+
+Combinando enlaces y grupos, puedes crear una amplia variedad de diseños de barra lateral.
+
+### Enlaces
+
+Agrega un enlace a una página interna o externa usando un objeto con las propiedades `label` y `link`.
+
+```js
+starlight({
+ sidebar: [
+ // Un enlace a la guía CSS y Estilos.
+ { label: 'CSS y Estilos', link: '/guides/css-and-tailwind/' },
+ // Un enlace externo al sitio web de Astro.
+ { label: 'Astro', link: 'https://astro.build/' },
+ ],
+});
+```
+
+La configuración anterior genera la siguiente barra lateral:
+
+
+
+### Grupos
+
+Puedes agregar una estructura a tu barra lateral agrupando enlaces relacionados bajo un encabezado plegable.
+Los Grupos pueden contener tanto enlaces como otros subgrupos.
+
+Agrega un grupo usando un objeto con las propiedades `label` y `items`.
+La `label` se utilizará como encabezado del grupo.
+Agrega enlaces o subgrupos al arreglo `items`.
+
+```js
+starlight({
+ sidebar: [
+ // Un grupo de enlaces etiquetados como "Guides"
+ {
+ label: 'Guías',
+ items: [
+ { label: 'Componentes', link: '/guides/components/' },
+ { label: 'Internacionalización (i18n)', link: '/guides/i18n/' },
+ // Un grupo anidado de enlaces.
+ {
+ label: 'Estilando',
+ items: [
+ { label: 'CSS', link: '/guides/css-and-tailwind/' },
+ { label: 'Tailwind', link: '/guides/css-and-tailwind/' },
+ { label: 'Shiki', link: '/guides/css-and-tailwind/' },
+ ],
+ },
+ ],
+ },
+ ],
+});
+```
+
+La configuración anterior genera la siguiente barra lateral:
+
+
+
+### Grupos autogenerados
+
+Starlight puede generar automáticamente un grupo en tu barra lateral basado en un directorio de tu documentación.
+Esto es útil cuando no deseas ingresar manualmente cada elemento de la barra lateral en un grupo.
+Las páginas serán ordenadas alfabéticamente por nombre de archivo de forma predeterminada.
+
+Agrega un grupo autogenerado usando un objeto con las propiedades `label` y `autogenerate`. Tu configuración `autogenerate` debe especificar el `directory` para usar en las entradas de la barra lateral. Por ejemplo, con la siguiente configuración:
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guías',
+ // Autogenera un grupo de enlaces para el directorio 'guides'.
+ autogenerate: { directory: 'guides' },
+ },
+ ],
+});
+```
+
+Y la siguiente estructura de archivos:
+
+
+
+- src/
+ - content/
+ - docs/
+ - guides/
+ - components.md
+ - i18n.md
+ - advanced/
+ - project-structure.md
+
+
+
+La siguiente barra lateral se generará automáticamente:
+
+
+
+#### Personalización de enlaces autogenerados en el frontmatter
+
+Usa el campo [`sidebar`](/es/reference/frontmatter/#sidebar) en las páginas individuales para personalizar los enlaces autogenerados.
+
+Las opciones del frontmatter de la barra lateral te permiten establecer un [etiqueta personalizada](/es/reference/frontmatter/#label) o agregar una [insignia](/es/reference/frontmatter/#badge) a un enlace, [ocultar](/es/reference/frontmatter/#hidden) un enlace de la barra lateral o definir un [peso de ordenación personalizado](/es/reference/frontmatter/#order).
+
+```md
+---
+title: Mi página
+sidebar:
+ # Configura una etiqueta personalizada para el enlace
+ label: Etiqueta personalizada de la barra lateral
+ # Establece un orden personalizado para el enlace (los números más bajos se muestran más arriba)
+ order: 2
+ # Agrega una insignia al enlace
+ badge:
+ text: Nuevo
+ variant: tip
+---
+```
+
+Un grupo autogenerado que incluye una página con el frontmatter anterior generará la siguiente barra lateral:
+
+
+
+:::note
+La configuración `sidebar` del frontmatter solo se usa para enlaces autogenerados y se ignorará para enlaces definidos manualmente.
+:::
+
+## Insignias
+
+Los enlaces también pueden incluir una propiedad `badge` para mostrar una insignia junto a la etiqueta del enlace.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guías',
+ items: [
+ // Un enlace con una insignia "Nuevo".
+ {
+ label: 'Componentes',
+ link: '/guides/components/',
+ badge: 'Nuevo',
+ },
+ ],
+ },
+ ],
+});
+```
+
+La configuración anterior genera la siguiente barra lateral:
+
+
+
+### Variantes de insignia
+
+Personaliza el estilo de la insignia usando un objeto con las propiedades `text` y `variant`.
+
+La propiedad `text` representa el contenido a mostrar (por ejemplo, "Nuevo").
+Remplaza el estilo `default`, que usa el color de acento de tu sitio, estableciendo la propiedad `variant` a uno de los siguientes valores: `note`, `tip`, `danger`, `caution` o `success`.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guías',
+ items: [
+ // Un enlace con una insignia "Experimental" amarilla.
+ {
+ label: 'Componentes',
+ link: '/guides/components/',
+ badge: { text: 'Experimental', variant: 'caution' },
+ },
+ ],
+ },
+ ],
+});
+```
+
+La configuración anterior genera la siguiente barra lateral:
+
+
+
+## Internacionalización
+
+Usa la propiedad `translations` en las entradas de enlace y grupo para traducir la etiqueta del enlace o grupo para cada idioma compatible.
+
+La propiedad `label` se utilizará para el idioma predeterminado y para los idiomas sin traducción.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guides',
+ translations: {
+ es: 'Guías',
+ },
+ items: [
+ {
+ label: 'Components',
+ translations: {
+ es: 'Componentes',
+ },
+ link: '/guides/components/',
+ },
+ {
+ label: 'Internationalization (i18n)',
+ translations: {
+ es: 'Internacionalización (i18n)',
+ },
+ link: '/guides/i18n/',
+ },
+ ],
+ },
+ ],
+});
+```
+
+Navegar por la documentación en español generará la siguiente barra lateral:
+
+
+
+## Grupos colapsables
+
+Los grupos de enlaces pueden colapsarse por defecto estableciendo la propiedad `collapsed` en `true`.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guías',
+ // Collapsa el grupo de forma predeterminada.
+ collapsed: true,
+ items: [
+ { label: 'Componentes', link: '/guides/components/' },
+ { label: 'Internacionalización (i18n)', link: '/guides/i18n/' },
+ ],
+ },
+ ],
+});
+```
+
+La configuración anterior genera la siguiente barra lateral:
+
+
+
+[Grupos autogenerados](#grupos-autogenerados) respetan el valor `collapsed` de su grupo padre:
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guías',
+ // Colapsa el grupo y sus subgrupos autogenerados de forma predeterminada.
+ collapsed: true,
+ autogenerate: { directory: 'guides' },
+ },
+ ],
+});
+```
+
+La configuración anterior genera la siguiente barra lateral:
+
+
+
+Este comportamiento puede remplazarse definiendo la propiedad `autogenerate.collapsed`.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guías',
+ // No colapsa el grupo "Guides" pero colapsa sus
+ // subgrupos autogenerados.
+ collapsed: false,
+ autogenerate: { directory: 'guides', collapsed: true },
+ },
+ ],
+});
+```
+
+La configuración anterior genera la siguiente barra lateral:
+
+
diff --git a/docs/src/content/docs/es/reference/frontmatter.md b/docs/src/content/docs/es/reference/frontmatter.md
index b7388e973f4..d80f99bd6da 100644
--- a/docs/src/content/docs/es/reference/frontmatter.md
+++ b/docs/src/content/docs/es/reference/frontmatter.md
@@ -209,9 +209,23 @@ Lo mismo que [`prev`](#prev), pero para el enlace de la página siguiente.
next: false
```
+### `pagefind`
+
+**tipo:** `boolean`
+**por defecto:** `true`
+
+Establece si esta página debe incluirse en el índice de búsqueda de [Pagefind](https://pagefind.app/). Establece en `false` para excluir una página de los resultados de búsqueda:
+
+```md
+---
+# Ocultar esta página del índice de búsqueda
+pagefind: false
+---
+```
+
### `sidebar`
-**tipo:** `{ label?: string; order?: number; hidden?: boolean }`
+**tipo:** `{ label?: string; order?: number; hidden?: boolean; badge?: string | BadgeConfig }`
Controla cómo se muestra esta página en el [sidebar](/reference/configuration/#sidebar) al utilizar un grupo de enlaces generado automáticamente.
@@ -259,3 +273,30 @@ sidebar:
hidden: true
---
```
+
+#### `badge`
+
+**tipo:** string | BadgeConfig
+
+Agrega una insignia a la página en la barra lateral cuando se muestra en un grupo de enlaces generado automáticamente.
+Cuando se usa un string, la insignia se mostrará con el color de acento predeterminado.
+Opcionalmente, pasa un objeto [`BadgeConfig`](/es/reference/configuration/#badgeconfig) con los campos `text` y `variant` para personalizar la insignia.
+
+```md
+---
+title: Página con una insignia
+sidebar:
+ # Usa la variante predeterminada que coincide con el color de acento de tu sitio
+ badge: Nuevo
+---
+```
+
+```md
+---
+title: Página con una insignia
+sidebar:
+ badge:
+ text: Experimental
+ variant: caution
+---
+```
diff --git a/docs/src/content/docs/es/showcase.mdx b/docs/src/content/docs/es/showcase.mdx
index fc56e50d6ad..2a28fab0bac 100644
--- a/docs/src/content/docs/es/showcase.mdx
+++ b/docs/src/content/docs/es/showcase.mdx
@@ -10,84 +10,11 @@ description: ¡Descubre los sitios construidos con Starlight y herramientas comu
## Sitios
-import Card from '../../../components/showcase-card.astro';
-import FluidGrid from '../../../components/fluid-grid.astro';
+import ShowcaseSites from '../../../components/showcase-sites.astro';
Starlight ya está siendo utilizado en producción. Estos son algunos de los sitios en la web:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
Consulta todos los [repositorios de proyectos públicos que utilizan Starlight en GitHub](https://github.com/withastro/starlight/network/dependents).
diff --git a/docs/src/content/docs/fr/guides/customization.mdx b/docs/src/content/docs/fr/guides/customization.mdx
index 32e993d9afc..1185031c6d0 100644
--- a/docs/src/content/docs/fr/guides/customization.mdx
+++ b/docs/src/content/docs/fr/guides/customization.mdx
@@ -87,6 +87,19 @@ Vous pouvez afficher différentes versions de votre logo en modes clair et sombr
}),
```
+## Activer un plan de site
+
+Starlight possède une prise en charge intégrée pour la génération d’un plan de site. Activez la génération du plan de site en définissant votre URL comme `site` dans `astro.config.mjs`:
+
+```js
+// astro.config.mjs
+
+export default defineConfig({
+ site: 'https://stargazers.club',
+ integrations: [starlight({ title: 'Site avec un plan de site' })],
+});
+```
+
## Mise en Page
Par défaut, les pages Starlight utilisent une mise en page avec une barre latérale de navigation globale et une table des matières qui affiche les titres de la page courante.
@@ -178,7 +191,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 Bitbucket, Codeberg, Codepen, Discord, GitHub, GitLab, Gitter, Instagram, LinkedIn, Mastodon, Microsoft Teams, Threads, Twitch, Twitter et Youtube sont pris en charge.
+Actuellement, les liens vers Bitbucket, Codeberg, Codepen, Discord, GitHub, GitLab, Gitter, Instagram, LinkedIn, Mastodon, Microsoft Teams, Stack Overflow, Threads, Twitch, 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
diff --git a/docs/src/content/docs/fr/guides/i18n.mdx b/docs/src/content/docs/fr/guides/i18n.mdx
index 158c1153260..7613f777c5b 100644
--- a/docs/src/content/docs/fr/guides/i18n.mdx
+++ b/docs/src/content/docs/fr/guides/i18n.mdx
@@ -143,7 +143,7 @@ Si une traduction n'est pas encore disponible pour une langue, Starlight affiche
En plus d'héberger des fichiers de contenu traduits, Starlight vous permet de traduire les chaînes de l'interface utilisateur par défaut (par exemple, l'en-tête "Sur cette page" dans la table des matières) afin que vos lecteurs puissent découvrir votre site entièrement dans la langue sélectionnée.
-Les textes de l'interface utilisateur traduits en anglais, arabe, allemand, chinois simplifié, danois, espagnol, français, italien, japonais, néerlandais, norvégien, farsi, portugais, tchèque, turc, coréen et suédois sont disponibles prêts à l'emploi, et nous acceptons les [contributions pour ajouter d'autres langues par défaut](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md).
+Les textes de l'interface utilisateur traduits en anglais, arabe, allemand, chinois simplifié, danois, espagnol, français, italien, japonais, néerlandais, norvégien, farsi, hébreu, portugais, tchèque, turc, coréen, indonésien, russe et suédois sont disponibles prêts à l'emploi, et nous acceptons les [contributions pour ajouter d'autres langues par défaut](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md).
Vous pouvez fournir des traductions pour les langues supplémentaires que vous supportez - ou remplacer nos étiquettes par défaut - via la collection de données `i18n`.
diff --git a/docs/src/content/docs/fr/reference/configuration.md b/docs/src/content/docs/fr/reference/configuration.md
index c841629b5b4..9dcaa23e101 100644
--- a/docs/src/content/docs/fr/reference/configuration.md
+++ b/docs/src/content/docs/fr/reference/configuration.md
@@ -184,12 +184,24 @@ type SidebarItem = {
label: string;
translations?: Record;
} & (
- | { link: string }
+ | {
+ link: string;
+ badge?: string | BadgeConfig;
+ }
| { items: SidebarItem[] }
| { autogenerate: { directory: string } }
);
```
+#### `BadgeConfig`
+
+```ts
+interface BadgeConfig {
+ text: string;
+ variant: 'note' | 'tip' | 'caution' | 'danger' | 'success' | 'default';
+}
+```
+
### `locales`
**type:** { \[dir: string\]: [LocaleConfig](#localeconfig) }
@@ -292,7 +304,7 @@ La locale par défaut sera utilisée pour fournir un contenu de remplacement lor
### `social`
-**type:** `Partial>`
+**type:** `Partial>`
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.
diff --git a/docs/src/content/docs/fr/reference/frontmatter.md b/docs/src/content/docs/fr/reference/frontmatter.md
index c8c73243fc3..06ca8890c6b 100644
--- a/docs/src/content/docs/fr/reference/frontmatter.md
+++ b/docs/src/content/docs/fr/reference/frontmatter.md
@@ -208,9 +208,23 @@ next: false
---
```
+### `pagefind`
+
+**type:** `boolean`
+**default:** `true`
+
+Définit si cette page doit être incluse dans l'index de recherche de [Pagefind](https://pagefind.app/). Définissez la valeur à `false` pour exclure une page des résultats de recherche :
+
+```md
+---
+# Exclut cette page de l'index de recherche
+pagefind: false
+---
+```
+
### `sidebar`
-**type:** `{ label?: string; order?: number; hidden?: boolean }`
+**type:** `{ label?: string; order?: number; hidden?: boolean; badge?: string | BadgeConfig }`
Contrôler l'affichage de cette page dans la [barre latérale](/fr/reference/configuration/#sidebar), lors de l'utilisation d'un groupe de liens généré automatiquement.
@@ -258,3 +272,30 @@ sidebar:
hidden: true
---
```
+
+#### `badge`
+
+**type:** string | BadgeConfig
+
+Ajoute un badge à la page dans la barre latérale lorsqu'elle est affichée dans un groupe de liens généré automatiquement.
+Lors de l'utilisation d'une chaîne de caractères, le badge sera affiché avec une couleur d'accentuation par défaut.
+Passez éventuellement un [objet `BadgeConfig`](/fr/reference/configuration/#badgeconfig) avec les propriétés `text` et `variant` pour personnaliser le badge.
+
+```md
+---
+title: Page avec un badge
+sidebar:
+ # Utilise la variante par défaut correspondant à la couleur d'accentuation de votre site
+ badge: Nouveau
+---
+```
+
+```md
+---
+title: Page avec un badge
+sidebar:
+ badge:
+ text: Expérimental
+ variant: caution
+---
+```
diff --git a/docs/src/content/docs/fr/showcase.mdx b/docs/src/content/docs/fr/showcase.mdx
index b553ae77861..482871bb6f1 100644
--- a/docs/src/content/docs/fr/showcase.mdx
+++ b/docs/src/content/docs/fr/showcase.mdx
@@ -10,84 +10,11 @@ Ouvrez une PR en ajoutant un lien à cette page !
## Sites
-import Card from '../../../components/showcase-card.astro';
-import FluidGrid from '../../../components/fluid-grid.astro';
+import ShowcaseSites from '../../../components/showcase-sites.astro';
Starlight est déjà utilisé en production. Voici quelques sites sur le web :
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
Voir tous les [dépôts publics de projets utilisant Starlight sur GitHub](https://github.com/withastro/starlight/network/dependents).
diff --git a/docs/src/content/docs/guides/customization.mdx b/docs/src/content/docs/guides/customization.mdx
index 03d85dbf8c6..4bd9ac9a815 100644
--- a/docs/src/content/docs/guides/customization.mdx
+++ b/docs/src/content/docs/guides/customization.mdx
@@ -87,6 +87,19 @@ You can display different versions of your logo in light and dark modes.
}),
```
+## Enable sitemap
+
+Starlight has built-in support for generating a sitemap. Enable sitemap generation by setting your URL as `site` in `astro.config.mjs`:
+
+```js
+// astro.config.mjs
+
+export default defineConfig({
+ site: 'https://stargazers.club',
+ integrations: [starlight({ title: 'Site with sitemap' })],
+});
+```
+
## Page layout
By default, Starlight pages use a layout with a global navigation sidebar and a table of contents that shows the current page headings.
diff --git a/docs/src/content/docs/guides/i18n.mdx b/docs/src/content/docs/guides/i18n.mdx
index 0015b4e78fa..ec8086b060b 100644
--- a/docs/src/content/docs/guides/i18n.mdx
+++ b/docs/src/content/docs/guides/i18n.mdx
@@ -143,7 +143,7 @@ If a translation is not yet available for a language, Starlight will show reader
In addition to hosting translated content files, Starlight allows you to translate the default UI strings (e.g. the "On this page" heading in the table of contents) so that your readers can experience your site entirely in the selected language.
-English, Czech, French, German, Italian, Japanese, Portuguese, Dutch, Danish, Spanish, Turkish, Arabic, Norwegian, Farsi, Simplified Chinese, Korean, and Swedish translated UI strings are provided out of the box, and we welcome [contributions to add more default languages](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md).
+English, Czech, French, German, Italian, Japanese, Portuguese, Dutch, Danish, Spanish, Turkish, Arabic, Norwegian, Farsi, Hebrew, Simplified Chinese, Korean, Indonesian, Russian, and Swedish translated UI strings are provided out of the box, and we welcome [contributions to add more default languages](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md).
You can provide translations for additional languages you support — or override our default labels — via the `i18n` data collection.
diff --git a/docs/src/content/docs/guides/sidebar.mdx b/docs/src/content/docs/guides/sidebar.mdx
new file mode 100644
index 00000000000..f1b508b56f1
--- /dev/null
+++ b/docs/src/content/docs/guides/sidebar.mdx
@@ -0,0 +1,474 @@
+---
+title: Sidebar Navigation
+description: Learn how to set up and customize your Starlight site’s sidebar navigation links.
+sidebar:
+ badge: New
+---
+
+import FileTree from '../../../components/file-tree.astro';
+import SidebarPreview from '../../../components/sidebar-preview.astro';
+
+A well-organized sidebar is key to a good documentation as it is one of the main ways users will navigate your site. Starlight provides a complete set of options to customize your sidebar layout and content.
+
+## Default sidebar
+
+By default, Starlight will automatically generate a sidebar based on the filesystem structure of your documentation, using each file's `title` property as the sidebar entry.
+
+For example, given the following file structure:
+
+
+
+- src/
+ - content/
+ - docs/
+ - guides/
+ - components.md
+ - i18n.md
+ - reference/
+ - configuration.md
+
+
+
+The following sidebar will be automatically generated:
+
+
+
+Learn more about autogenerated sidebars in the [autogenerated groups](#autogenerated-groups) section.
+
+## Add links and link groups
+
+To configure your sidebar [links](#links) and [groups of links](#groups) (within a collapsible header), use the [`starlight.sidebar`](/reference/configuration/#sidebar) property in `astro.config.mjs`.
+
+By combining links and groups, you can create a wide variety of sidebar layouts.
+
+### Links
+
+Add a link to an internal or external page using an object with `label` and `link` properties.
+
+```js
+starlight({
+ sidebar: [
+ // A link to the CSS & Styling guide.
+ { label: 'CSS & Styling', link: '/guides/css-and-tailwind/' },
+ // An external link to the Astro website.
+ { label: 'Astro', link: 'https://astro.build/' },
+ ],
+});
+```
+
+The configuration above generates the following sidebar:
+
+
+
+### Groups
+
+You can add structure to your sidebar by grouping related links together under a collapsible heading.
+Groups can contain both links and other sub-groups.
+
+Add a group using an object with `label` and `items` properties.
+The `label` will be used as the heading for the group.
+Add links or subgroups to the `items` array.
+
+```js
+starlight({
+ sidebar: [
+ // A group of links labelled "Guides".
+ {
+ label: 'Guides',
+ items: [
+ { label: 'Components', link: '/guides/components/' },
+ { label: 'Internationalization (i18n)', link: '/guides/i18n/' },
+ // A nested group of links.
+ {
+ label: 'Styling',
+ items: [
+ { label: 'CSS', link: '/guides/css-and-tailwind/' },
+ { label: 'Tailwind', link: '/guides/css-and-tailwind/' },
+ { label: 'Shiki', link: '/guides/css-and-tailwind/' },
+ ],
+ },
+ ],
+ },
+ ],
+});
+```
+
+The configuration above generates the following sidebar:
+
+
+
+### Autogenerated groups
+
+Starlight can automatically generate a group in your sidebar based on a directory of your docs.
+This is helpful when you do not want to manually enter each sidebar item in a group.
+Pages will be sorted alphabetically by filename by default.
+
+Add an autogenerated group using an object with `label` and `autogenerate` properties. Your `autogenerate` configuration must specify the `directory` to use for sidebar entries. For example, with the following configuration:
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guides',
+ // Autogenerate a group of links for the 'guides' directory.
+ autogenerate: { directory: 'guides' },
+ },
+ ],
+});
+```
+
+And the following file structure:
+
+
+
+- src/
+ - content/
+ - docs/
+ - guides/
+ - components.md
+ - i18n.md
+ - advanced/
+ - project-structure.md
+
+
+
+The following sidebar will be generated:
+
+
+
+#### Customizing autogenerated links in frontmatter
+
+Use the [`sidebar` frontmatter field](/reference/frontmatter/#sidebar) in individual pages to customize autogenerated links.
+
+Sidebar frontmatter options allow you to set a [custom label](/reference/frontmatter/#label) or add a [badge](/reference/frontmatter/#badge) to a link, [hide](/reference/frontmatter/#hidden) a link from the sidebar, or define a [custom sort weighting](/reference/frontmatter/#order).
+
+```md
+---
+title: My page
+sidebar:
+ # Set a custom label for the link
+ label: Custom sidebar label
+ # Set a custom order for the link (lower numbers are displayed higher up)
+ order: 2
+ # Add a badge to the link
+ badge:
+ text: New
+ variant: tip
+---
+```
+
+An autogenerated group including a page with the frontmatter above will generate the following sidebar:
+
+
+
+:::note
+The `sidebar` frontmatter configuration is only used for autogenerated links and will be ignored for manually defined links.
+:::
+
+## Badges
+
+Links can also include a `badge` property to display a badge next to the link label.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guides',
+ items: [
+ // A link with a "New" badge.
+ {
+ label: 'Components',
+ link: '/guides/components/',
+ badge: 'New',
+ },
+ ],
+ },
+ ],
+});
+```
+
+The configuration above generates the following sidebar:
+
+
+
+### Badge variants
+
+Customize the badge styling using an object with `text` and `variant` properties.
+
+The `text` represents the content to display (e.g. "New").
+Override the `default` styling, which uses the accent color of your site, by setting the `variant` property to one of the following values: `note`, `tip`, `danger`, `caution` or `success`.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guides',
+ items: [
+ // A link with a yellow "Experimental" badge.
+ {
+ label: 'Components',
+ link: '/guides/components/',
+ badge: { text: 'Experimental', variant: 'caution' },
+ },
+ ],
+ },
+ ],
+});
+```
+
+The configuration above generates the following sidebar:
+
+
+
+## Internationalization
+
+Use the `translations` property on link and group entries to translate the link or group label for each supported language.
+The `label` property will be used for the default locale and for languages without a translation.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guides',
+ translations: {
+ es: 'Guías',
+ },
+ items: [
+ {
+ label: 'Components',
+ translations: {
+ es: 'Componentes',
+ },
+ link: '/guides/components/',
+ },
+ {
+ label: 'Internationalization (i18n)',
+ translations: {
+ es: 'Internacionalización (i18n)',
+ },
+ link: '/guides/i18n/',
+ },
+ ],
+ },
+ ],
+});
+```
+
+Browsing the documentation in Spanish will generate the following sidebar:
+
+
+
+## Collapsing groups
+
+Groups of links can be collapsed by default by setting the `collapsed` property to `true`.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guides',
+ // Collapse the group by default.
+ collapsed: true,
+ items: [
+ { label: 'Components', link: '/guides/components/' },
+ { label: 'Internationalization (i18n)', link: '/guides/i18n/' },
+ ],
+ },
+ ],
+});
+```
+
+The configuration above generates the following sidebar:
+
+
+
+[Autogenerated groups](#autogenerated-groups) respect the `collapsed` value of their parent group:
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guides',
+ // Collapse the group and its autogenerated subgroups by default.
+ collapsed: true,
+ autogenerate: { directory: 'guides' },
+ },
+ ],
+});
+```
+
+The configuration above generates the following sidebar:
+
+
+
+This behavior can be overridden by defining the `autogenerate.collapsed` property.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guides',
+ // Do not collapse the "Guides" group but collapse its
+ // autogenerated subgroups.
+ collapsed: false,
+ autogenerate: { directory: 'guides', collapsed: true },
+ },
+ ],
+});
+```
+
+The configuration above generates the following sidebar:
+
+
diff --git a/docs/src/content/docs/id/getting-started.mdx b/docs/src/content/docs/id/getting-started.mdx
new file mode 100644
index 00000000000..45b53ce181b
--- /dev/null
+++ b/docs/src/content/docs/id/getting-started.mdx
@@ -0,0 +1,129 @@
+---
+title: Memulai
+description: Pelajari cara membuat situs dokumentasi baru Anda dengan Starlight oleh Astro.
+---
+
+import { Tabs, TabItem } from '@astrojs/starlight/components';
+
+## Membuat Proyek Baru
+
+Starlight adalah tema dokumentasi berfitur lengkap berbasis [Astro](https://astro.build).
+
+Anda dapat membuat proyek Astro + Starlight baru menggunakan perintah berikut ini:
+
+
+
+
+```sh
+# membuat proyek baru dengan npm
+npm create astro@latest -- --template starlight
+```
+
+
+
+
+```sh
+# membuat proyek baru dengan pnpm
+pnpm create astro --template starlight
+```
+
+
+
+
+```sh
+# membuat proyek baru dengan yarn
+yarn create astro --template starlight
+```
+
+
+
+
+Perintah tersebut akan membuat [direktori proyek](/guides/project-structure/) baru beserta seluruh file dan konfigurasi untuk situs Anda.
+
+:::tip[Coba dulu]
+Cobalah Starlight di browser:
+[buka dengan StackBlitz](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics).
+:::
+
+## Membuat konten dengan Starlight
+
+Starlight sudah siap untuk ditambahkan konten baru, atau pindahkan konten lama Anda!
+
+### Format file
+
+Starlight mendukung pembuatan konten dalam Markdown and MDX. (Tambahkan dukungan Markdoc dengan menginstall integrasi eksperimental [Astro Markdoc](https://docs.astro.build/en/guides/integrations-guide/markdoc/).)
+
+### Tambah halaman baru
+
+Tambah halaman baru dengan cara membuat file `.md` or `.mdx` di `src/content/docs/`. Tambahkan folder untuk mengorganisasikan konten Anda, dan membuat segmen _path_ bertingkat:
+
+```
+src/content/docs/hello-world.md => your-site.com/hello-world
+src/content/docs/guides/faq.md => your-site.com/guides/faq
+```
+
+### _Frontmatter_ dengan _type-safety_ yang aman
+
+Semua halaman Starlight terdiri dari [properti _frontmatter_ umum](/id/reference/frontmatter/) yang dapat dikostumisasi untuk mengontrol tampilan setiap halaman:
+
+```md
+---
+title: Hello, World!
+description: This is a page in my Starlight-powered site
+---
+```
+
+Jika ada properti yang terlewat, Starlight akan memberitahu Anda.
+
+## _Deploy_ situs Starlight Anda
+
+Setelah Anda membuat dan mengkostumisasi situs Starlight anda, anda dapat men-_deploy_ situs anda ke web server atau platform hosting pilihan Anda, termasuk Netlify, Vercel, GitHub Pages dan lain sebagainya.
+
+[Pelajari cara men-_deploy_ situs Astro di dokumentasi Astro.](https://docs.astro.build/en/guides/deploy/)
+
+## Memperbaharui Starlight
+
+:::tip
+Karena Starlight masih berstatus beta, akan ada pembaruan dan peningkatan yang cukup sering. Pastikan Anda selalu memperbaharui Starlight secara rutin!
+:::
+
+Starlight adalah integrasi Astro, dan cara memperbaharuinya sama seperti integrasi `@astrojs/*` yang lain:
+
+
+
+
+```sh
+# memperbaharui Starlight dengan npm
+npm install @astrojs/starlight@latest
+```
+
+
+
+
+```sh
+# memperbaharui Starlight dengan pnpm
+pnpm upgrade @astrojs/starlight --latest
+```
+
+
+
+
+```sh
+# memperbaharui Starlight dengan yarn
+yarn upgrade @astrojs/starlight --latest
+```
+
+
+
+
+Anda dapat membaca semua histori pembaruan Starlight dalam setiap rilis di [_changelog_](https://github.com/withastro/starlight/blob/main/packages/starlight/CHANGELOG.md).
+
+## Menyelesaikan masalah pada Starlight
+
+[Konfigurasi proyek](/id/reference/configuration/) dan [konfigurasi _frontmatter_](/id/reference/frontmatter/) tersedia di bagian Referensi pada situs ini. Rujuklah halaman tersebut untuk memastikan situs Starlight anda terkonfigurasi dengan benar dan berfungsi dengan baik.
+
+Anda juga dapat merujuk kepada panduan di _sidebar_ untuk membantu Anda dalam menambah konten dan mengkustomisasi situs Starlight anda.
+
+Jika Anda tidak menemukan jawaban di dokumentasi ini, silahkan merujuk kepada [dokumentasi lengkap Astro](https://docs.astro.build). Pertanyaan Anda biasanya akan terjawab dengan memahami bagaimana umumnya Astro bekerja, sebagai basis dari Starlight.
+
+Anda juga dapat merujuk kepada [isu-isu yang diketahui di GitHub](https://github.com/withastro/starlight/issues), dan mendapatka bantuan melalui [Astro Discord](https://astro.build/chat/) oleh komunitas kami yang ramah dan sangat aktif! Silahkan bertanya di forum `#support` menggunakan tag "starlight" tag, atau kunjungi channel `#starlight` untuk mendiskusikan pengembangan Starlight, dan lain-lain!
diff --git a/docs/src/content/docs/id/index.mdx b/docs/src/content/docs/id/index.mdx
new file mode 100644
index 00000000000..c75ef9d0dd1
--- /dev/null
+++ b/docs/src/content/docs/id/index.mdx
@@ -0,0 +1,58 @@
+---
+title: Starlight 🌟 Wujudkan situs dokumentasi dengan Astro
+description: Starlight membantu mewujudkan situs web dokumentasi yang menawan dan berperforma tinggi dengan Astro.
+template: splash
+banner:
+ content: |
+
+
+
+ Halo Product Hunters 👋
+ Kami sedang live sekarang!
+
+
+hero:
+ title: Buat dokumentasi yang bersinar dengan Starlight
+ tagline: Semua yang Anda butuhkan untuk mewujudkan situs dokumentasi yang luar biasa. Cepat, ramah pengguna, dan sangat mudah digunakan.
+ image:
+ file: ../../../assets/hero-star.webp
+ actions:
+ - text: Memulai
+ icon: right-arrow
+ variant: primary
+ link: /id/getting-started/
+ - text: Lihat di GitHub
+ icon: external
+ link: https://github.com/withastro/starlight
+---
+
+import { CardGrid, Card } from '@astrojs/starlight/components';
+import AboutAstro from '../../../components/about-astro.astro';
+
+
+
+ Sudah termasuk: Navigasi situs, pencarian, terjemahan, SEO, tipografi yang
+ mudah dibaca, _code highlighting_, mode gelap, dan masih banyak lagi.
+
+
+ Manfaatkan kekuatan penuh dan performa Astro. Kembangkan Starlight dengan
+ pustaka dan integrasi Astro favorit Anda.
+
+
+ Gunakan bahasa markup favorit Anda. Starlight menyediakan validasi
+ _frontmatter_ bawaan dengan TypeScript _type-safety_.
+
+
+ Starlight adalah solusi dokumentasi yang lengkap dan _framework-agnostic_.
+ Kembangkan lebih jauh dengan React, Vue, Svelte, Solid, dan lain-lain.
+
+
+
+
+Astro adalah _framework_ web serbaguna didesain untuk web yang cepat.
+Gunakan konten Anda dari sumber mana saja dan _deploy_ di mana saja,
+semua ditenagai dengan pustaka dan komponen UI favorit Anda.
+
+[Pelajari tentang Astro](https://astro.build/)
+
+
diff --git a/docs/src/content/docs/it/404.md b/docs/src/content/docs/it/404.md
new file mode 100644
index 00000000000..9129fe113b6
--- /dev/null
+++ b/docs/src/content/docs/it/404.md
@@ -0,0 +1,13 @@
+---
+title: Non trovato
+template: splash
+editUrl: false
+hero:
+ title: '404'
+ tagline: Houston, abbiamo un problema. Non siamo riusciti a trovare quella pagina.
Controlla l'URL o prova a utilizzare la barra di ricerca.
+ actions:
+ - text: Torna alla home
+ icon: right-arrow
+ link: /it/
+ variant: primary
+---
diff --git a/docs/src/content/docs/it/getting-started.mdx b/docs/src/content/docs/it/getting-started.mdx
index 96102aed030..49feb43e56f 100644
--- a/docs/src/content/docs/it/getting-started.mdx
+++ b/docs/src/content/docs/it/getting-started.mdx
@@ -117,3 +117,13 @@ yarn upgrade @astrojs/starlight --latest
Puoi esplorare tutte le modifiche effettuate in ogni aggiornamento nel [changelog Starlight](https://github.com/withastro/starlight/blob/main/packages/starlight/CHANGELOG.md).
+
+## Risoluzione dei problemi relativi a Starlight
+
+Sia le informazioni sulla [configurazione del progetto](/reference/configuration/) che sulla [configurazione del frontmatter della singola pagina](/reference/frontmatter/) di Starlight sono disponibili nella sezione Riferimenti di questo sito. Utilizza queste pagine per assicurarti che il tuo sito Starlight sia configurato e funzioni correttamente.
+
+Consulta l'elenco crescente di guide nella barra laterale per ricevere assistenza nell'aggiunta di contenuti e nella personalizzazione del tuo sito Starlight.
+
+Se non è possibile trovare la risposta in questi documenti, visitare la [documentazione completa di Astro](https://docs.astro.build) per la documentazione completa di Astro. È possibile rispondere alla tua domanda comprendendo come funziona Astro in generale, sotto questo tema Starlight.
+
+Puoi anche verificare eventuali [problemi di Starlight noti su GitHub](https://github.com/withastro/starlight/issues) e ottenere assistenza nella sezione [Astro Discord](https://astro.build/chat/) dalla nostra comunità attiva e amichevole! Pubblica domande nel nostro forum `#support` con il tag "starlight" o visita il nostro canale dedicato `#starlight` per discutere dello sviluppo attuale e altro ancora!
diff --git a/docs/src/content/docs/it/guides/authoring-content.md b/docs/src/content/docs/it/guides/authoring-content.md
index 4b3c5038157..a857e9eec80 100644
--- a/docs/src/content/docs/it/guides/authoring-content.md
+++ b/docs/src/content/docs/it/guides/authoring-content.md
@@ -29,7 +29,7 @@ Puoi evidenziare `codice in linea` con apici inversi.
## Immagini
-Le immagini in Starlight utilizzano l'ottimizzazione degli asset di Astro.
+Le immagini in Starlight utilizzano [l'ottimizzazione degli asset di Astro](https://docs.astro.build/it/guides/assets/).
Markdown e MDX supportano la sintassi Markdown per rappresentare immagini che includono testo alternativo per le tecnologie assistive.
@@ -80,7 +80,7 @@ description: Come utilizzare i link automatici di Starlight
## Introduzione
-Posso collegarmi alla [conclusione](#conclusione) che si trova più in basso.
+Posso collegarmi alla [mia conclusione](#conclusione) che si trova più in basso.
## Conclusione
@@ -89,9 +89,9 @@ Posso collegarmi alla [conclusione](#conclusione) che si trova più in basso.
Titoli di livello 2 (``) e di livello 3 (``) verranno inclusi automaticamente nella tabella dei contenuti.
-## Asides
+## Aside
-Gli aside (conosciuti anche come "richiami") sono utili per indicare contenuti secondari insieme ai contenuti principali.
+Gli aside (conosciuti anche come "ammonizioni" o "richiami") sono utili per indicare contenuti secondari insieme ai contenuti principali.
Starlight fornisce una sintassi Markdown personalizzata per indicarli. I blocchi aside sono indicati da `:::` per racchiudere i contenuti e possono essere di tipo `note`, `tip`, `caution` o `danger`.
@@ -103,7 +103,7 @@ Dentro un "aside" puoi inserire qualsiasi altro contenuto Markdown anche se sono
Starlight è uno strumento per siti da documentazione con [Astro](https://astro.build/). Puoi iniziare con questo comando:
```sh
-npm run create astro@latest --template starlight
+npm run create astro@latest -- --template starlight
```
:::
@@ -114,7 +114,7 @@ Starlight è uno strumento per siti da documentazione con [Astro](https://astro.
Puoi iniziare con questo comando:
```sh
-npm run create astro@latest --template starlight
+npm run create astro@latest -- --template starlight
```
:::
diff --git a/docs/src/content/docs/it/guides/components.mdx b/docs/src/content/docs/it/guides/components.mdx
index 082e16b373c..07c6952a075 100644
--- a/docs/src/content/docs/it/guides/components.mdx
+++ b/docs/src/content/docs/it/guides/components.mdx
@@ -105,3 +105,66 @@ Aggiungi l'attributo `stagger` per rappresentare la seconda colonna più in bass
```
:::
+
+### LinkCard
+
+Utilizza il componente `` per collegare in modo visibile pagine diverse.
+
+Una `` richiede un `title` e un attributo [`href`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href). Facoltativamente puoi includere una breve `description` o altri attributi del collegamento come `target`.
+
+Raggruppa più componenti `` in `` per visualizzare le schede una accanto all'altra quando c'è spazio sufficiente.
+
+```mdx
+import { LinkCard, CardGrid } from '@astrojs/starlight/components';
+
+
+
+
+
+
+
+```
+
+Il codice precedente genera quanto segue nella pagina:
+
+import { LinkCard } from '@astrojs/starlight/components';
+
+
+
+
+
+
+
+
+### Icon
+
+import { Icon } from '@astrojs/starlight/components';
+import IconsList from '../../../../components/icons-list.astro';
+
+Starlight fornisce una serie di icone comuni che puoi visualizzare nei tuoi contenuti utilizzando il componente ``.
+
+Ogni `` richiede un [`name`](#all-icons) e può facoltativamente includere un attributo `label`, `size` e `color`.
+
+```mdx
+import { Icon } from '@astrojs/starlight/components';
+
+
+```
+
+Il codice sopra genera quanto segue nella pagina:
+
+
+
+#### All icons
+
+Di seguito è riportato un elenco di tutte le icone disponibili con i nomi associati. Fare clic su un'icona per copiarne il codice componente.
+
+
diff --git a/docs/src/content/docs/it/guides/css-and-tailwind.mdx b/docs/src/content/docs/it/guides/css-and-tailwind.mdx
new file mode 100644
index 00000000000..8fc7a825812
--- /dev/null
+++ b/docs/src/content/docs/it/guides/css-and-tailwind.mdx
@@ -0,0 +1,290 @@
+---
+title: CSS e stile
+description: Scopri come personalizzare lo stile del tuo sito Starlight con CSS personalizzati o integrarlo con Tailwind CSS.
+---
+
+Puoi modellare il tuo sito Starlight con file CSS personalizzati o utilizzare il plug-in Starlight Tailwind.
+
+## Stili CSS personalizzati
+
+Personalizza gli stili applicati al tuo sito Starlight fornendo file CSS aggiuntivi per modificare o estendere gli stili predefiniti di Starlight.
+
+1. Aggiungi un file CSS alla tua directory `src/`.
+ Ad esempio, potresti impostare una larghezza predefinita della colonna più ampia e una dimensione del testo più grande per i titoli delle pagine:
+
+ ```css
+ /* src/styles/custom.css */
+ :root {
+ --sl-content-width: 50rem;
+ --sl-text-5xl: 3.5rem;
+ }
+ ```
+
+2. Aggiungi il percorso del tuo file CSS all'array `customCss` di Starlight in `astro.config.mjs`:
+
+ ```js
+ // astro.config.mjs
+ import { defineConfig } from 'astro/config';
+ import starlight from '@astrojs/starlight';
+
+ export default defineConfig({
+ integrations: [
+ starlight({
+ title: 'Docs With Custom CSS',
+ customCss: [
+ // Percorso relativo al tuo file CSS personalizzato
+ './src/styles/custom.css',
+ ],
+ }),
+ ],
+ });
+ ```
+
+Puoi vedere tutte le proprietà personalizzate CSS utilizzate da Starlight che puoi impostare per personalizzare il tuo sito nel [file `props.css` su GitHub](https://github.com/withastro/starlight/blob/main/packages/starlight/style/props.css).
+
+## CSS Tailwind
+
+Il supporto CSS Tailwind nei progetti Astro è fornito dall'[integrazione Astro Tailwind](https://docs.astro.build/en/guides/integrations-guide/tailwind/).
+Starlight fornisce un plug-in Tailwind complementare per aiutare a configurare Tailwind per la compatibilità con gli stili di Starlight.
+
+Il plugin Starlight Tailwind applica la seguente configurazione:
+
+- Configura le varianti `dark:` di Tailwind per funzionare con la modalità dark di Starlight.
+- Utilizza Tailwind [colori e caratteri del tema](#styling-di-starlight-con-tailwind) nell'interfaccia utente di Starlight.
+- Disabilita gli stili di ripristino [Preflight](https://tailwindcss.com/docs/preflight) di Tailwind ripristinando selettivamente le parti essenziali di Preflight richieste per le classi di utilità sui bordi di Tailwind.
+
+### Crea un nuovo progetto con Tailwind
+
+import { Tabs, TabItem } from '@astrojs/starlight/components';
+
+Avvia un nuovo progetto Starlight con Tailwind CSS preconfigurato utilizzando `create astro`:
+
+
+
+
+```sh
+npm create astro@latest -- --template starlight/tailwind
+```
+
+
+
+
+```sh
+pnpm create astro --template starlight/tailwind
+```
+
+
+
+
+```sh
+yarn create astro --template starlight/tailwind
+```
+
+
+
+
+### Aggiungi Tailwind a un progetto esistente
+
+Se hai già un sito Starlight e desideri aggiungere Tailwind CSS, segui questi passaggi.
+
+1. Aggiungi l'integrazione Tailwind di Astro:
+
+
+
+
+
+ ```sh
+ npx astro add tailwind
+ ```
+
+
+
+
+
+ ```sh
+ pnpm astro add tailwind
+ ```
+
+
+
+
+
+ ```sh
+ yarn astro add tailwind
+ ```
+
+
+
+
+
+2. Installa il plugin Starlight Tailwind:
+
+
+
+
+
+ ```sh
+ npm install @astrojs/starlight-tailwind
+ ```
+
+
+
+
+
+ ```sh
+ pnpm install @astrojs/starlight-tailwind
+ ```
+
+
+
+
+
+ ```sh
+ yarn add @astrojs/starlight-tailwind
+ ```
+
+
+
+
+
+3. Crea un file CSS per gli stili di base di Tailwind, ad esempio in `src/tailwind.css`:
+
+ ```css
+ /* src/tailwind.css */
+ @tailwind base;
+ @tailwind components;
+ @tailwind utilities;
+ ```
+
+4. Aggiorna il file di configurazione Astro per utilizzare gli stili di base Tailwind e disabilitare gli stili di base predefiniti:
+
+ ```js {11-12,16-17}
+ // astro.config.mjs
+ import { defineConfig } from 'astro/config';
+ import starlight from '@astrojs/starlight';
+ import tailwind from '@astrojs/tailwind';
+
+ export default defineConfig({
+ integrations: [
+ starlight({
+ title: 'Docs with Tailwind',
+ customCss: [
+ // Percorso per gli stili di base di Tailwind
+ './src/tailwind.css',
+ ],
+ }),
+ tailwind({
+ // Disattiva gli stili di base predefiniti
+ applyBaseStyles: false,
+ }),
+ ],
+ });
+ ```
+
+5. Aggiungi il plugin Starlight Tailwind a `tailwind.config.cjs`:
+
+ ```js ins={2,7}
+ // tailwind.config.cjs
+ const starlightPlugin = require('@astrojs/starlight-tailwind');
+
+ /** @type {import('tailwindcss').Config} */
+ module.exports = {
+ content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
+ plugins: [starlightPlugin()],
+ };
+ ```
+
+### Styling di Starlight con Tailwind
+
+Starlight utilizzerà i valori della [configurazione del tema Tailwind](https://tailwindcss.com/docs/theme) nella sua interfaccia utente.
+
+Se impostate, le seguenti opzioni sovrascriveranno gli stili predefiniti di Starlight:
+
+- `colors.accent` — utilizzato per i collegamenti e per l'evidenziazione dell'elemento corrente
+- `colors.gray`: utilizzato per i colori e i bordi dello sfondo
+- `fontFamily.sans`: utilizzato per l'interfaccia utente e il testo del contenuto
+- `fontFamily.mono` — utilizzato per esempi di codice
+
+```js {12,14,18,20}
+// tailwind.config.cjs
+const starlightPlugin = require('@astrojs/starlight-tailwind');
+const colors = require('tailwindcss/colors');
+
+/** @type {import('tailwindcss').Config} */
+module.exports = {
+ content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
+ theme: {
+ extend: {
+ colors: {
+ // Il tuo colore preferito. Indigo è il più vicino alle impostazioni predefinite di Starlight.
+ accent: colors.indigo,
+ // La tua scala di grigi preferita. Lo zinco è il più vicino ai valori predefiniti di Starlight.
+ gray: colors.zinc,
+ },
+ fontFamily: {
+ sans: ['"Atkinson Hyperlegible"'],
+ // Il tuo carattere di testo preferito. Starlight utilizza uno stack di caratteri di sistema per impostazione predefinita.
+ sans: ['"Atkinson Hyperlegible"'],
+ // Il tuo carattere di codice preferito. Starlight utilizza i caratteri di sistema a spaziatura fissa per impostazione predefinita.
+ mono: ['"IBM Plex Mono"'],
+ },
+ },
+ },
+ plugins: [starlightPlugin()],
+};
+```
+
+## Temi
+
+Il tema colore di Starlight può essere controllato sovrascrivendo le sue proprietà personalizzate predefinite.
+Queste variabili vengono utilizzate in tutta l'interfaccia utente con una gamma di sfumature di grigio utilizzate per i colori del testo e dello sfondo e un colore in risalto utilizzato per i collegamenti e per evidenziare gli elementi correnti nella navigazione.
+
+### Editor di temi colore
+
+Utilizza i dispositivi di scorrimento qui sotto per modificare l'accento di Starlight e le tavolozze dei colori grigi.
+Le aree di anteprima scure e chiare mostreranno i colori risultanti e anche l'intera pagina verrà aggiornata per visualizzare in anteprima le modifiche.
+
+Quando sei soddisfatto delle modifiche, copia il codice CSS o Tailwind di seguito e utilizzalo nel tuo progetto.
+
+import ThemeDesigner from '../../../../components/theme-designer.astro';
+
+
+
+ Aggiungi il seguente CSS al tuo progetto in un [file custom
+ CSS](#stili-css-personalizzati) per applicare questo tema al tuo sito.
+
+
+ L'esempio [file di configurazione di
+ Tailwind](#styling-di-starlight-con-tailwind) di seguito include tavolozze
+ di colori `accent` e `gray` generate da utilizzare in Oggetto di
+ configurazione `theme.extend.colors`.
+
+
diff --git a/docs/src/content/docs/it/guides/customization.mdx b/docs/src/content/docs/it/guides/customization.mdx
new file mode 100644
index 00000000000..236bda3062d
--- /dev/null
+++ b/docs/src/content/docs/it/guides/customization.mdx
@@ -0,0 +1,429 @@
+---
+title: Personalizzazione di Starlight
+description: Scopri come personalizzare il tuo sito Starlight con il tuo logo, caratteri personalizzati, design della pagina di destinazione e altro ancora.
+---
+
+import { Tabs, TabItem } from '@astrojs/starlight/components';
+import FileTree from '../../../../components/file-tree.astro';
+
+Starlight fornisce stili e funzionalità predefiniti sensati, così puoi iniziare rapidamente senza bisogno di configurazione.
+Se vuoi iniziare a personalizzare l'aspetto del tuo sito Starlight, questa guida fa al caso tuo.
+
+## Aggiungi il tuo logo
+
+L'aggiunta di un logo personalizzato all'intestazione del sito è un modo rapido per aggiungere il tuo marchio individuale a un sito Starlight.
+
+1. Aggiungi il file immagine del tuo logo alla directory `src/assets/`:
+
+
+
+ - src/
+ - assets/
+ - **my-logo.svg**
+ - content/
+ - astro.config.mjs
+
+
+
+2. Aggiungi il percorso del tuo logo come opzione [`logo.src`](/it/reference/configuration/#logo) di Starlight in `astro.config.mjs`:
+
+ ```js
+ // astro.config.mjs
+ import { defineConfig } from 'astro/config';
+ import starlight from '@astrojs/starlight';
+
+ export default defineConfig({
+ integrations: [
+ starlight({
+ title: 'Documentazione con il mio logo',
+ logo: {
+ src: './src/assets/my-logo.svg',
+ },
+ }),
+ ],
+ });
+ ```
+
+Per impostazione predefinita, il logo verrà visualizzato accanto al `title` del tuo sito.
+Se l'immagine del tuo logo include già il titolo del sito, puoi nascondere visivamente il testo del titolo impostando l'opzione `replacesTitle`.
+Il testo del `title` verrà comunque incluso per gli screen reader in modo che l'intestazione rimanga accessibile.
+
+```js
+starlight({
+ title: 'Documentazione con il mio logo',
+ logo: {
+ src: './src/assets/my-logo.svg',
+ replacesTitle: true,
+ },
+}),
+```
+
+### Varianti del logo chiaro e scuro
+
+Puoi visualizzare diverse versioni del tuo logo in modalità chiara e scura.
+
+1. Aggiungi un file immagine per ciascuna variante a `src/assets/`:
+
+
+
+ - src/
+ - assets/
+ - **light-logo.svg**
+ - **dark-logo.svg**
+ - content/
+ - astro.config.mjs
+
+
+
+2. Aggiungi il percorso alle varianti del tuo logo come opzioni `light` e `dark` invece di `src` in `astro.config.mjs`:
+
+ ```js
+ starlight({
+ title: 'Documentazione con il mio logo',
+ logo: {
+ light: './src/assets/light-logo.svg',
+ dark: './src/assets/dark-logo.svg',
+ },
+ }),
+ ```
+
+## Enable sitemap
+
+Starlight ha il supporto integrato per la generazione di una mappa del sito. Abilita la generazione della mappa del sito impostando il tuo URL come `site` in `astro.config.mjs`:
+
+```js
+// astro.config.mjs
+
+export default defineConfig({
+ site: 'https://stargazers.club/',
+ integrations: [starlight({ title: 'Sito con mappa del sito' })],
+});
+```
+
+## Layout della pagina
+
+Per impostazione predefinita, le pagine Starlight utilizzano un layout con una barra laterale di navigazione globale e un indice dei contenuti che mostra le intestazioni della pagina corrente.
+
+Puoi applicare un layout di pagina più ampio senza barre laterali impostando [`template: splash`](/it/reference/frontmatter/#template) nel frontmatter di una pagina.
+Funziona particolarmente bene per le pagine di destinazione e puoi vederlo in azione sulla [home page di questo sito](/it/).
+
+```md
+---
+# src/content/docs/index.md
+
+title: La mia pagina di destinazione
+template: splash
+---
+```
+
+## Indice dei contenuti
+
+Starlight visualizza un indice dei contenuti su ogni pagina per consentire ai lettori di passare più facilmente all'intestazione che stanno cercando.
+Puoi personalizzare, o addirittura disabilitare, l'indice dei contenuti a livello globale nell'integrazione Starlight o pagina per pagina in Frontmatter.
+
+Per impostazione predefinita, le intestazioni `` e `` sono incluse nell'indice dei contenuti. Modifica i livelli delle intestazioni da includere in tutto il sito utilizzando le opzioni `minHeadingLevel` e `maxHeadingLevel` nel tuo [global `tableOfContents`](/it/reference/configuration/#tableofcontents). Sostituisci queste impostazioni predefinite su una singola pagina aggiungendo le proprietà [frontmatter `tableOfContents`](/it/reference/frontmatter/#tableofcontents) corrispondenti:
+
+
+
+
+```md
+---
+# src/content/docs/example.md
+title: Pagina con solo H2 nell'indice dei contenuti
+summary:
+ minHeadingLevel: 2
+ maxHeadingLevel: 2
+---
+```
+
+
+
+
+```js
+// astro.config.mjs
+
+defineConfig({
+ integrations: [
+ starlight({
+ title: '',
+ tableOfContents: { minHeadingLevel: 2, maxHeadingLevel: 2 },
+ }),
+ ],
+});
+```
+
+
+
+
+Disabilita completamente l'indice dei contenuti impostando l'opzione `tableOfContents` su `false`:
+
+
+
+
+```md
+---
+# src/content/docs/esempio.md
+title: Pagina senza indice dei contenuti
+tableOfContents: false
+---
+```
+
+
+
+
+```js
+// astro.config.mjs
+
+defineConfig({
+ integrations: [
+ starlight({
+ title:
+ 'Documentazione con indice dei contenuti disabilitato a livello globale',
+ tableOfContents: false,
+ }),
+ ],
+});
+```
+
+
+
+
+## Collegamenti social
+
+Starlight dispone del supporto integrato per aggiungere collegamenti ai tuoi account di social media all'intestazione del sito tramite l'opzione [`social`](/it/reference/configuration/#social) nell'integrazione Starlight.
+
+Attualmente sono supportati i collegamenti a Bitbucket, Codeberg, CodePen, Discord, GitHub, GitLab, Gitter, Instagram, LinkedIn, Mastodon, Microsoft Teams, Stack Overflow, Threads, Twitch, Twitter e Youtube.
+Facci sapere su GitHub o Discord se hai bisogno di supporto per un altro servizio!
+
+```js
+// astro.config.mjs
+import { defineConfig } from 'astro/config';
+import starlight from '@astrojs/starlight';
+
+export default defineConfig({
+ integrations: [
+ starlight({
+ title: 'Documentazione con link social',
+ social: {
+ discord: 'https://astro.build/chat',
+ github: 'https://github.com/withastro/starlight',
+ },
+ }),
+ ],
+});
+```
+
+## Collegamenti di Modifica
+
+Starlight può visualizzare un collegamento "Modifica pagina" nel piè di pagina di ciascuna pagina.
+Ciò rende più semplice per il lettore trovare il file da modificare per migliorare i tuoi documenti.
+Per i progetti open source in particolare, questo può aiutare a incoraggiare i contributi della tua comunità.
+
+Per abilitare i collegamenti di modifica, imposta [`editLink.baseUrl`](/it/reference/configuration/#editlink) sull'URL utilizzato per modificare il tuo repository nella configurazione dell'integrazione Starlight.
+Il valore di `editLink.baseUrl` verrà anteposto al percorso della pagina corrente per formare il collegamento di modifica completo.
+
+I modelli comuni includono:
+
+- GitHub: `https://github.com/USER_NAME/REPO_NAME/edit/BRANCH_NAME/`
+- GitLab: `https://gitlab.com/USER_NAME/REPO_NAME/-/edit/BRANCH_NAME/`
+
+Se il tuo progetto Starlight non è nella radice del tuo repository, includi il percorso del progetto alla fine dell'URL di base.
+
+Questo esempio mostra il collegamento di modifica configurato per i documenti Starlight, che si trovano nella sottodirectory `docs/` sul ramo `main` del repository `withastro/starlight` su GitHub:
+
+```js
+// astro.config.mjs
+import { defineConfig } from 'astro/config';
+import starlight from '@astrojs/starlight';
+
+export default defineConfig({
+ integrations: [
+ starlight({
+ title: 'Documentazione con collegamenti di modifica',
+ editLink: {
+ baseUrl: 'https://github.com/withastro/starlight/edit/main/docs/',
+ },
+ }),
+ ],
+});
+```
+
+## Pagina 404 personalizzata
+
+Per impostazione predefinita, i siti Starlight visualizzano una semplice pagina 404.
+Puoi personalizzarlo aggiungendo un file `404.md` (o `404.mdx`) alla tua directory `src/content/docs/`:
+
+
+
+- src/
+ - content/
+ - docs/
+ - **404.md**
+ - index.md
+- astro.config.mjs
+
+
+
+Puoi utilizzare tutto il layout di pagina e le tecniche di personalizzazione di Starlight nella tua pagina 404. Ad esempio, la pagina 404 predefinita utilizza il componente [`splash` template](#page-layout) e [`hero`](/it/reference/frontmatter/#hero) in frontmatter:
+
+```md
+---
+title: '404'
+template: splash
+editUrl: false
+hero:
+ title: '404'
+ tagline: Pagina non trovata. Controlla l'URL o prova a utilizzare la barra di ricerca.
+---
+```
+
+## Caratteri personalizzati
+
+Per impostazione predefinita, Starlight utilizza i caratteri sans-serif disponibili sul dispositivo locale dell'utente per tutto il testo.
+Ciò garantisce che la documentazione venga caricata rapidamente in un carattere familiare a ciascun utente, senza richiedere larghezza di banda aggiuntiva per scaricare file di caratteri di grandi dimensioni.
+
+Se devi aggiungere un carattere personalizzato al tuo sito Starlight, puoi impostare i caratteri da utilizzare nei file CSS personalizzati o con qualsiasi altra [tecnica di stile Astro](https://docs.astro.build/it/guides/styling/) .
+
+### Imposta i caratteri
+
+Se disponi già di file di font, segui la [guida alla configurazione locale](#configura-i-file-dei-caratteri-locali).
+Per utilizzare Google Fonts, segui la [guida alla configurazione di Fontsource](#configura-un-font-fontsource).
+
+#### Configura i file dei caratteri locali
+
+1. Aggiungi i file dei caratteri a una directory `src/fonts/` e crea un file `font-face.css` vuoto:
+
+
+
+ - src/
+ - content/
+ - fonts/
+ - **CustomFont.woff2**
+ - **font-face.css**
+ - astro.config.mjs
+
+
+
+2. Aggiungi una [dichiarazione `@font-face`](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face) per ciascuno dei tuoi caratteri in `src/fonts/font-face.css`.
+ Utilizza un percorso relativo al file del font nella funzione `url()`.
+
+ ```css
+ /* src/fonts/font-face.css */
+
+ @font-face {
+ font-family: 'Font Personalizzato';
+ /* Utilizza un percorso relativo al file del font locale in `url()`. */
+ src: url('./CustomFont.woff2') format('woff2');
+ font-weight: normal;
+ font-style: normal;
+ font-display: swap;
+ }
+ ```
+
+3. Aggiungi il percorso del tuo file `font-face.css` all'array `customCss` di Starlight in `astro.config.mjs`:
+
+ ```js
+ // astro.config.mjs
+ import { defineConfig } from 'astro/config';
+ import starlight from '@astrojs/starlight';
+
+ export default defineConfig({
+ integrations: [
+ starlight({
+ title: 'Documentazione con font personalizzato',
+ customCss: [
+ // Percorso relativo al file CSS @font-face.
+ './src/fonts/font-face.css',
+ ],
+ }),
+ ],
+ });
+ ```
+
+#### Configura un font Fontsource
+
+Il progetto [Fontsource](https://fontsource.org/) semplifica l'utilizzo di Google Fonts e altri caratteri open source.
+Fornisce moduli npm che puoi installare per i caratteri che desideri utilizzare e include file CSS già pronti da aggiungere al tuo progetto.
+
+1. Trova il font che desideri utilizzare nel [catalogo di Fontsource](https://fontsource.org/).
+ Questo esempio utilizzerà [IBM Plex Serif](https://fontsource.org/fonts/ibm-plex-serif).
+
+2. Installa il pacchetto per il font scelto.
+ Puoi trovare il nome del pacchetto facendo clic su "Installa" nella pagina dei caratteri Fontsource.
+
+
+
+
+
+ ```sh
+ npm install @fontsource/ibm-plex-serif
+ ```
+
+
+
+
+
+ ```sh
+ pnpm install @fontsource/ibm-plex-serif
+ ```
+
+
+
+
+
+ ```sh
+ yarn add @fontsource/ibm-plex-serif
+ ```
+
+
+
+
+
+3. Aggiungi i file CSS Fontsource all'array `customCss` di Starlight in `astro.config.mjs`:
+
+ ```js
+ // astro.config.mjs
+ import { defineConfig } from 'astro/config';
+ import starlight from '@astrojs/starlight';
+
+ export default defineConfig({
+ integrations: [
+ starlight({
+ title: 'Docs With a Custom Typeface',
+ customCss: [
+ // File Fontsource per pesi di font regolari e semi-grassetto.
+ '@fontsource/ibm-plex-serif/400.css',
+ '@fontsource/ibm-plex-serif/600.css',
+ ],
+ }),
+ ],
+ });
+ ```
+
+ Fontsource fornisce più file CSS per ciascun font. Consulta la [documentazione Fontsource](https://fontsource.org/docs/getting-started/install#4-weights-and-styles) sull'inclusione di pesi e stili diversi per capire quale utilizzare.
+
+### Usa i caratteri
+
+Per applicare il font che hai impostato al tuo sito, utilizza il nome del font scelto in un [file CSS personalizzato](/it/guides/css-and-tailwind/#custom-css-styles).
+Ad esempio, per sovrascrivere ovunque il font predefinito di Starlight, imposta la proprietà personalizzata `--sl-font`:
+
+```css
+/* src/styles/custom.css */
+
+:root {
+ --sl-font: 'IBM Plex Serif', serif;
+}
+```
+
+Puoi anche scrivere CSS più mirati se desideri applicare il tuo font in modo più selettivo.
+Ad esempio, per impostare un font solo sul contenuto principale, ma non sulle barre laterali:
+
+```css
+/* src/styles/custom.css */
+
+main {
+ font-family: 'IBM Plex Serif', serif;
+}
+```
+
+Segui le [istruzioni CSS personalizzate](/it/guides/css-and-tailwind/#custom-css-styles) per aggiungere i tuoi stili al tuo sito.
diff --git a/docs/src/content/docs/it/guides/i18n.mdx b/docs/src/content/docs/it/guides/i18n.mdx
index 9a06c0efc91..8965b396272 100644
--- a/docs/src/content/docs/it/guides/i18n.mdx
+++ b/docs/src/content/docs/it/guides/i18n.mdx
@@ -143,7 +143,7 @@ Se una traduzione non è ancora disponibile per una lingua, Starlight mostrerà
In aggiunta alla possibilità di avere pagine multilingua, Starlight permette di tradurre le scritte dell'interfaccia (per esempio l'intestazione "In questa pagina" nella tabella dei contenuti) in modo che i lettori possano vedere il sito interamente nella lingua selezionata.
-Inglese, francese, tedesco, giapponese, portoghese, spagnolo e italiano sono disponibili di default, e sono benvenute [contribuzioni per aggiungere altre lingue](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md).
+Le stringhe dell'interfaccia utente tradotte in inglese, ceco, francese, tedesco, italiano, giapponese, portoghese, olandese, danese, spagnolo, turco, arabo, norvegese, farsi, cinese semplificato, coreano, russo e svedese sono disponibili di default e accettiamo [contributi per aggiungere altre lingue predefinite](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md).
Puoi fornire traduzioni per lingue aggiuntive — o sovrascrivere i valori predefiniti — con la collezione `i18n`.
diff --git a/docs/src/content/docs/it/guides/sidebar.mdx b/docs/src/content/docs/it/guides/sidebar.mdx
new file mode 100644
index 00000000000..b5d6570d9c2
--- /dev/null
+++ b/docs/src/content/docs/it/guides/sidebar.mdx
@@ -0,0 +1,480 @@
+---
+title: Navigazione nella barra laterale
+description: Scopri come impostare e personalizzare i collegamenti di navigazione della barra laterale del tuo sito Starlight.
+sidebar:
+ badge: Nuovo
+---
+
+import FileTree from '../../../../components/file-tree.astro';
+import SidebarPreview from '../../../../components/sidebar-preview.astro';
+
+Una barra laterale ben organizzata è fondamentale per una buona documentazione poiché è uno dei modi principali in cui gli utenti navigheranno nel tuo sito. Starlight fornisce un set completo di opzioni per personalizzare il layout e il contenuto della barra laterale.
+
+## Barra laterale predefinita
+
+Per impostazione predefinita, Starlight genererà automaticamente una barra laterale in base alla struttura del file system della documentazione, utilizzando la proprietà `title` di ciascun file come voce della barra laterale.
+
+Ad esempio, data la seguente struttura di file:
+
+
+
+- src/
+ - content/
+ - docs/
+ - guides/
+ - components.md
+ - i18n.md
+ - reference/
+ - configuration.md
+
+
+
+Verrà generata automaticamente la seguente barra laterale:
+
+
+
+Scopri di più sulle barre laterali generate automaticamente nella sezione [gruppi generati automaticamente](#gruppi-generati-automaticamente).
+
+## Aggiungi collegamenti e gruppi di collegamenti
+
+Per configurare i [link](#link) e i [gruppi di link](#gruppi) della barra laterale (all'interno di un'intestazione comprimibile), utilizza la proprietà [`starlight.sidebar`](/it/reference/configuration/#sidebar) in `astro.config.mjs`.
+
+Combinando collegamenti e gruppi, puoi creare un'ampia varietà di layout della barra laterale.
+
+### Collegamenti
+
+Aggiungi un collegamento a una pagina interna o esterna utilizzando un oggetto con le proprietà `label` e `link`.
+
+```js
+starlight({
+ sidebar: [
+ // Un collegamento alla guida CSS e stile.
+ { label: 'CSS e stile', link: '/guides/css-and-tailwind/' },
+ // Un collegamento esterno al sito web di Astro.
+ { label: 'Astro', link: 'https://astro.build/' },
+ ],
+});
+```
+
+La configurazione sopra genera la seguente barra laterale:
+
+
+
+### Gruppi
+
+Puoi aggiungere struttura alla barra laterale raggruppando i collegamenti correlati sotto un'intestazione comprimibile.
+I gruppi possono contenere sia collegamenti che altri sottogruppi.
+
+Aggiungi un gruppo utilizzando un oggetto con le proprietà `label` e `items`.
+`label` verrà utilizzato come intestazione del gruppo.
+Aggiungi collegamenti o sottogruppi all'array `items`.
+
+```js
+starlight({
+ sidebar: [
+ // Un gruppo di collegamenti etichettati "Guide".
+ {
+ label: 'Guide',
+ items: [
+ { label: 'Componenti', link: '/guides/components/' },
+ { label: 'Internazionalizzazione (i18n)', link: '/guides/i18n/' },
+ // Un gruppo nidificato di collegamenti.
+ {
+ label: 'Stile',
+ items: [
+ { label: 'CSS', link: '/guides/css-and-tailwind/' },
+ { label: 'Tailwind', link: '/guides/css-and-tailwind/' },
+ { label: 'Shiki', link: '/guides/css-and-tailwind/' },
+ ],
+ },
+ ],
+ },
+ ],
+});
+```
+
+La configurazione sopra genera la seguente barra laterale:
+
+
+
+### Gruppi generati automaticamente
+
+Starlight può generare automaticamente un gruppo nella barra laterale in base a una directory dei tuoi documenti.
+Ciò è utile quando non desideri inserire manualmente ciascun elemento della barra laterale in un gruppo.
+Per impostazione predefinita, le pagine verranno ordinate alfabeticamente in base al nome del file.
+
+Aggiungi un gruppo generato automaticamente utilizzando un oggetto con le proprietà `label` e `autogenerate`. La tua configurazione di `autogenerate` deve specificare quale `directory` da utilizzare per le voci della barra laterale. Ad esempio, con la seguente configurazione:
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guides',
+ // Genera automaticamente un gruppo di collegamenti per la directory 'guides'.
+ autogenerate: { directory: 'guides' },
+ },
+ ],
+});
+```
+
+E la seguente struttura di file:
+
+
+
+- src/
+ - content/
+ - docs/
+ - guides/
+ - components.md
+ - i18n.md
+ - advanced/
+ - project-structure.md
+
+
+
+Verrà generata la seguente barra laterale:
+
+
+
+#### Personalizzazione dei collegamenti generati automaticamente nel frontmatter
+
+Utilizza il [campo frontmatter `sidebar`](/it/reference/frontmatter/#sidebar) nelle singole pagine per personalizzare i collegamenti generati automaticamente.
+
+Le opzioni frontmatter della barra laterale ti consentono di impostare un'[etichetta personalizzata](/it/reference/frontmatter/#label) o aggiungere un [badge](/it/reference/frontmatter/#badge) a un collegamento, [nascondi](/it/reference/frontmatter/#hidden) un collegamento dalla barra laterale o definire un [ponderazione dell'ordinamento personalizzato](/it/reference/frontmatter/#order).
+
+```md
+---
+title: La mia pagina
+sidebar:
+ # Imposta un'etichetta personalizzata per il collegamento
+ label: etichetta personalizzata della barra laterale
+ # Imposta un ordine personalizzato per il collegamento (i numeri inferiori vengono visualizzati più in alto)
+ order: 2
+ # Aggiungi un badge al collegamento
+ badge:
+ text: Nuovo
+ variant: tip
+---
+```
+
+Un gruppo generato automaticamente che include una pagina con il frontmatter sopra genererà la seguente barra laterale:
+
+
+
+:::note
+La configurazione del frontmatter `sidebar` viene utilizzata solo per i collegamenti generati automaticamente e verrà ignorata per i collegamenti definiti manualmente.
+:::
+
+## Badge
+
+I collegamenti possono anche includere una proprietà `badge` per visualizzare un badge accanto all'etichetta del collegamento.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guide',
+ items: [
+ // Un collegamento con un badge "Nuovo".
+ {
+ label: 'Componenti',
+ link: '/guides/components/',
+ badge: 'Nuovo',
+ },
+ ],
+ },
+ ],
+});
+```
+
+La configurazione sopra genera la seguente barra laterale:
+
+
+
+### Varianti del badge
+
+Personalizza lo stile del badge utilizzando un oggetto con proprietà `text` e `variant`.
+
+Il `text` rappresenta il contenuto da visualizzare (ad esempio "Nuovo").
+Sostituisci lo stile `default`, che utilizza il colore in risalto del tuo sito, impostando la proprietà `variant` su uno dei seguenti valori: `note`, `tip`, `danger`, `caution` o `success`.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guide',
+ items: [
+ // Un collegamento con un badge giallo "Sperimentale".
+ {
+ label: 'Componenti',
+ link: '/guides/components/',
+ badge: { text: 'Sperimentale', variant: 'caution' },
+ },
+ ],
+ },
+ ],
+});
+```
+
+La configurazione sopra genera la seguente barra laterale:
+
+
+
+## Internazionalizzazione
+
+Utilizza la proprietà `translations` sulle voci dei collegamenti e dei gruppi per tradurre il collegamento o l'etichetta del gruppo per ciascuna lingua supportata.
+La proprietà `label` verrà utilizzata per la locale predefinita e per le lingue senza traduzione.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guide',
+ translations: {
+ es: 'Guías',
+ },
+ items: [
+ {
+ label: 'Componenti',
+ translations: {
+ es: 'Componentes',
+ },
+ link: '/guides/components/',
+ },
+ {
+ label: 'Internazionalizzazione (i18n)',
+ translations: {
+ es: 'Internacionalización (i18n)',
+ },
+ link: '/guides/i18n/',
+ },
+ ],
+ },
+ ],
+});
+```
+
+La navigazione della documentazione in spagnolo genererà la seguente barra laterale:
+
+
+
+## Gruppi che si riducono
+
+I gruppi di collegamenti possono essere compressi per impostazione predefinita impostando la proprietà `collapsed` su `true`.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guide',
+ // Comprimi il gruppo per impostazione predefinita.
+ collapsed: true,
+ items: [
+ { label: 'Componenti', link: '/guides/components/' },
+ { label: 'Internazionalizzazione (i18n)', link: '/guides/i18n/' },
+ ],
+ },
+ ],
+});
+```
+
+La configurazione sopra genera la seguente barra laterale:
+
+
+
+[I gruppi generati automaticamente](#gruppi-generati-automaticamente) rispettano il valore `collapsed` del gruppo principale:
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guide',
+ // Comprimi il gruppo e i relativi sottogruppi generati automaticamente per impostazione predefinita.
+ collapsed: true,
+ autogenerate: { directory: 'guides' },
+ },
+ ],
+});
+```
+
+La configurazione sopra genera la seguente barra laterale:
+
+
+
+Questo comportamento può essere ignorato definendo la proprietà `autogenerate.collapsed`.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guide',
+ // Non comprimere il gruppo "Guide", ma comprimerlo
+ // sottogruppi generati automaticamente.
+ collapsed: false,
+ autogenerate: { directory: 'guides', collapsed: true },
+ },
+ ],
+});
+```
+
+La configurazione sopra genera la seguente barra laterale:
+
+
diff --git a/docs/src/content/docs/it/index.mdx b/docs/src/content/docs/it/index.mdx
index fcc989049fa..61bb8c07344 100644
--- a/docs/src/content/docs/it/index.mdx
+++ b/docs/src/content/docs/it/index.mdx
@@ -2,6 +2,15 @@
title: Starlight 🌟 Costruire siti per documentazione con Astro
description: Starlight ti aiuta a creare siti belli e performanti con Astro.
template: splash
+banner:
+ content: |
+
+
+
+ Benvenuti Product Hunters 👋
+ Siamo live ora!
+
+
hero:
title: Fai brillare la tua documentazione con Starlight
tagline: Tutto quello di cui hai bisogno per creare documentazione stellare. Veloce, accessibile e facile da usare.
diff --git a/docs/src/content/docs/it/manual-setup.mdx b/docs/src/content/docs/it/manual-setup.mdx
new file mode 100644
index 00000000000..8791ce0df6b
--- /dev/null
+++ b/docs/src/content/docs/it/manual-setup.mdx
@@ -0,0 +1,128 @@
+---
+title: Configurazione manuale
+description: Scopri come configurare manualmente Starlight per aggiungerlo a un progetto Astro esistente.
+---
+
+import { Tabs, TabItem } from '@astrojs/starlight/components';
+
+Il modo più rapido per creare un nuovo sito Starlight è utilizzare `create astro` come mostrato nella [guida introduttiva](/it/getting-started/#creating-a-new-project).
+Se desideri aggiungere Starlight a un progetto Astro esistente, questa guida spiegherà come.
+
+## Configura Starlight
+
+Per seguire questa guida, avrai bisogno di un progetto Astro esistente.
+
+### Aggiungi l'integrazione Starlight
+
+Starlight è un'[integrazione Astro](https://docs.astro.build/it/guides/integrations-guide/). Aggiungilo al tuo sito eseguendo il comando `astro add` nella directory principale del tuo progetto:
+
+
+
+ ```sh
+ npx astro add starlight
+ ```
+
+
+
+ ```sh
+ pnpm astro add starlight
+ ```
+
+
+ ```sh
+ yarn astro add starlight
+ ```
+
+
+
+
+Questo installerà le dipendenze richieste e aggiungerà Starlight all'array `integrations` nel tuo file di configurazione Astro.
+
+### Configura l'integrazione
+
+L'integrazione Starlight è configurata nel file `astro.config.mjs`.
+
+Aggiungi un `title` per iniziare:
+
+```js {7-9}
+// astro.config.mjs
+import { defineConfig } from 'astro/config';
+import starlight from '@astrojs/starlight';
+
+export default defineConfig({
+ integrations: [
+ starlight({
+ title: 'Il mio meraviglioso sito di documentazione',
+ }),
+ ],
+});
+```
+
+Trova tutte le opzioni disponibili nel [riferimento per la configurazione di Starlight](/it/reference/configuration/).
+
+### Configura raccolte di contenuti
+
+Starlight si basa sulle [raccolte di contenuti](https://docs.astro.build/it/guides/content-collections/) di Astro, che sono configurate nel file `src/content/config.ts`.
+
+Crea o aggiorna il file di configurazione del contenuto, aggiungendo una raccolta `docs` che utilizza `docsSchema` di Starlight:
+
+```js ins={3,6}
+// src/content/config.ts
+import { defineCollection } from 'astro:content';
+import { docsSchema } from '@astrojs/starlight/schema';
+
+export const collections = {
+ docs: defineCollection({ schema: docsSchema() }),
+};
+```
+
+### Aggiungi contenuto
+
+Starlight è ora configurato ed è ora di aggiungere alcuni contenuti!
+
+Crea una directory `src/content/docs/` e inizia aggiungendo un file `index.md`.
+Questa sarà la home page del tuo nuovo sito:
+
+```md
+---
+# src/content/docs/index.md
+title: I miei documenti
+description: Scopri di più sul mio progetto in questo sito di documenti creato con Starlight.
+---
+
+Benvenuti nel mio progetto!
+```
+
+Starlight utilizza il routing basato su file, il che significa che ogni file Markdown, MDX o Markdoc in `src/content/docs/` verrà trasformato in una pagina sul tuo sito. I metadati di Frontmatter (i campi `title` e `description` nell'esempio sopra) possono modificare il modo in cui viene visualizzata ciascuna pagina.
+Vedi tutte le opzioni disponibili nel [riferimento frontmatter](/it/reference/frontmatter/).
+
+## Suggerimenti per i siti esistenti
+
+Se hai un progetto Astro esistente, puoi utilizzare Starlight per aggiungere rapidamente una sezione di documentazione al tuo sito.
+
+### Usa Starlight in un sottopercorso
+
+Per aggiungere tutte le pagine Starlight in un sottopercorso, posiziona tutto il contenuto dei tuoi documenti in una sottodirectory di `src/content/docs/`.
+
+Ad esempio, se le pagine Starlight dovessero iniziare tutte con `/guides/`, aggiungi il contenuto nella directory `src/content/docs/guides/`:
+
+import FileTree from '../../../components/file-tree.astro';
+
+
+
+- src/
+ - content/
+ - docs/
+ - **guides/**
+ - guide.md
+ - index.md
+ - pages/
+- astro.config.mjs
+
+
+
+In futuro, prevediamo di supportare meglio questo caso d'uso per evitare la necessità di una directory all'interno di una directory aggiuntiva in `src/content/docs/`.
+
+### Usa Starlight con SSR
+
+Attualmente, Starlight non supporta [distribuzione SSR](https://docs.astro.build/it/guides/server-side-rendering/) utilizzando gli adattatori server di Astro. Speriamo di poterlo supportare presto.
diff --git a/docs/src/content/docs/it/reference/configuration.md b/docs/src/content/docs/it/reference/configuration.md
index 1fadaf13974..950e7cf0106 100644
--- a/docs/src/content/docs/it/reference/configuration.md
+++ b/docs/src/content/docs/it/reference/configuration.md
@@ -44,7 +44,7 @@ Definisce il logo da rappresentare nella barra di navigazione con o al posto del
```js
starlight({
logo: {
- src: '/src/assets/my-logo.svg',
+ src: './src/assets/my-logo.svg',
},
});
```
@@ -87,13 +87,20 @@ Con questa configurazione, una pagina `/introduction` avrà un link di modifica
Configura la barra laterale di navigazione del tuo sito.
-Una barra laterale è un array di gruppi, ognuno avente un `label` e o un array `items` o un oggetto `autogenerate`.
+Una barra laterale è un array di collegamenti e gruppi di collegamenti.
+Ogni elemento avente un `label` e una delle seguenti proprietà:
-Puoi manualmente impostare i contenuti di un gruppo con `items`, che è un array che può includere link e sottogruppi. Puoi anche automaticamente generare i contenuti di un gruppo da una specifica cartella della documentazione utilizzando `autogenerate`.
+- `link` — un singolo colelgamento a uno specifico URL, ad es. `'/home'` o `'https://example.com'`.
+
+- `items` — an aray contenente più collegamenti della barra laterale e sottogruppi.
+
+- `autogenerate` — un oggetto indicante una cartella dei tuoi documenti di cui generare automaticamente i collegamenti.
```js
starlight({
sidebar: [
+ // Un singolo elemento chiamato “Home”.
+ { label: 'Home', link: '/' },
// Un gruppo intitolato "Inizia qui" contenente due link.
{
label: 'Inizia qui',
@@ -116,6 +123,34 @@ starlight({
I gruppi generati automaticamente sono ordinati alfabeticamente.
Per esempio, una pagina generata da `astro.md` apparirà sopra a quella generata da `starlight.md`.
+#### Gruppi comprimibili
+
+I gruppi di collegamenti vengono espansi per impostazione predefinita. Puoi modificare questo comportamento impostando la proprietà `collapsed` di un gruppo su `true`.
+
+I sottogruppi generati automaticamente rispettano la proprietà `collapsed` del gruppo principale per impostazione predefinita. Imposta la proprietà `autogenerate.collapsed` per sovrascriverla.
+
+```js
+sidebar: [
+ // Un gruppo di collegamenti compresso.
+ {
+ label: 'Collegamenti compressi',
+ collapsed: true,
+ items: [
+ { label: 'Introduzione', link: '/intro' },
+ { label: 'Prossimi passi', link: '/next-steps' },
+ ],
+ },
+ // An expanded group containing collapsed autogenerated subgroups.
+ {
+ label: 'Riferimenti',
+ autogenerate: {
+ directory: 'reference',
+ collapsed: true,
+ },
+ },
+],
+```
+
#### Tradurre i titoli
Se il tuo sito è multilingua, ogni elemento di `label` è considerato come appartenente alla lingua di default. Puoi definire `translations` per fornire i titoli per le altre lingue:
@@ -139,33 +174,34 @@ sidebar: [
},
],
},
-];
+],
```
-#### `SidebarGroup`
+#### `SidebarItem`
```ts
-type SidebarGroup =
+type SidebarItem = {
+ label: string;
+ translations?: Record;
+} & (
| {
- label: string;
- translations?: Record;
- items: Array;
+ link: string;
+ badge?: string | BadgeConfig;
}
+ | { items: SidebarItem[]; collapsed?: boolean }
| {
- label: string;
- translations?: Record;
- autogenerate: {
- directory: string;
- };
- };
+ autogenerate: { directory: string; collapsed?: boolean };
+ collapsed?: boolean;
+ }
+);
```
-#### `LinkItem`
+#### `BadgeConfig`
```ts
-interface LinkItem {
- label: string;
- link: string;
+interface BadgeConfig {
+ text: string;
+ variant: 'note' | 'tip' | 'caution' | 'danger' | 'success' | 'default';
}
```
@@ -271,17 +307,23 @@ Verrà utilizzato come fallback per le pagine non tradotte.
### `social`
-**type:** `{ discord?: string; github?: string; mastodon?: string; twitter?: string }`
+**type:** `Partial>`
Dettagli opzionali per gli account social del sito. Se vengono aggiunti apparirà l'icona corrispondente nella barra superiore.
```js
starlight({
social: {
+ codeberg: 'https://codeberg.org/knut/examples',
discord: 'https://astro.build/chat',
github: 'https://github.com/withastro/starlight',
+ gitlab: 'https://gitlab.com/delucis',
+ linkedin: 'https://www.linkedin.com/company/astroinc',
mastodon: 'https://m.webtoo.ls/@astro',
+ threads: 'https://www.threads.net/@nmoodev',
+ twitch: 'https://www.twitch.tv/bholmesdev',
twitter: 'https://twitter.com/astrodotbuild',
+ youtube: 'https://youtube.com/@astrodotbuild',
},
});
```
@@ -332,3 +374,53 @@ interface HeadConfig {
content?: string;
}
```
+
+### `lastUpdated`
+
+**type:** `boolean`
+**default:** `false`
+
+Controlla se il piè di pagina mostra quando è stata aggiornata l'ultima volta la pagina.
+
+Per impostazione predefinita, questa funzionalità si basa sulla cronologia Git del repository e potrebbe non essere accurata su alcune piattaforme di distribuzione che eseguono [cloni superficiali](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt). Una pagina può sovrascrivere questa impostazione o la data basata su Git utilizzando il [campo frontmatter `lastUpdated`](/it/reference/frontmatter/#lastupdated).
+
+### `pagination`
+
+**type:** `boolean`
+**default:** `true`
+
+Definisci se il piè di pagina deve includere i collegamenti alla pagina precedente e successiva.
+
+Una pagina può sovrascrivere questa impostazione o il testo del collegamento e/o l'URL utilizzando i campi frontmatter [`prev`](/it/reference/frontmatter/#prev) e [`next`](/it/reference/frontmatter/#next).
+
+### `favicon`
+
+**type:** `string`
+**default:** `'/favicon.svg'`
+
+Imposta il percorso della favicon predefinita per il tuo sito web che dovrebbe trovarsi nella directory `public/` ed essere valido (`.ico`, `.gif`, `.jpg`, `.png` o `.svg`) file di icone.
+
+```js
+starlight({
+ favicon: '/images/favicon.svg',
+}),
+```
+
+Se devi impostare varianti aggiuntive o favicon di fallback, puoi aggiungere tag utilizzando l'[opzione`head`](#head):
+
+```js
+starlight({
+ favicon: '/images/favicon.svg'.
+ head: [
+ // Aggiungi il fallback della favicon ICO per Safari.
+ {
+ tag: 'link',
+ attrs: {
+ rel: 'icon',
+ href:'/images/favicon.ico',
+ sizes: '32x32',
+ },
+ },
+ ],
+});
+```
diff --git a/docs/src/content/docs/it/reference/frontmatter.md b/docs/src/content/docs/it/reference/frontmatter.md
index 681b8d78145..3a76d172498 100644
--- a/docs/src/content/docs/it/reference/frontmatter.md
+++ b/docs/src/content/docs/it/reference/frontmatter.md
@@ -57,6 +57,22 @@ head:
Sovrascrive la [configurazione globale `tableOfContents`](/it/reference/configuration/#tableofcontents).
Cambia i livelli di titoli inclusi o, se messo a `false`, nasconde la tabella dei contenuti della pagina.
+```md
+---
+title: Pagina con solo H2 nella tabella dei contenuti della pagina
+tableOfContents:
+ minHeadingLevel: 2
+ maxHeadingLevel: 2
+---
+```
+
+```md
+---
+title: Pagina senza tabella dei contenuti della pagina
+tableOfContents: false
+---
+```
+
### `template`
**type:** `'doc' | 'splash'`
@@ -117,3 +133,169 @@ interface HeroConfig {
}>;
}
```
+
+### `banner`
+
+**type:** `{ content: string }`
+
+Visualizza un banner di annuncio nella parte superiore di questa pagina.
+
+Il valore `content` può includere HTML per collegamenti o altri contenuti.
+Ad esempio, questa pagina visualizza un banner che include un collegamento a `example.com`.
+
+```md
+---
+title: Pagina con un banner
+banner:
+ content: |
+ Abbiamo appena lanciato qualcosa di interessante!
+ Dai un'occhiata
+---
+```
+
+### `lastUpdated`
+
+**type:** `Date | boolean`
+
+Sostituisce l'[opzione globale `lastUpdated`](/it/reference/configuration/#lastupdated). Se viene specificata una data, deve essere un [timestamp YAML](https://yaml.org/type/timestamp.html) valido e sovrascriverà la data archiviata nella cronologia Git per questa pagina.
+
+```md
+---
+title: Pagina con una data di ultimo aggiornamento personalizzata
+lastUpdated: 2022-08-09
+---
+```
+
+### `prev`
+
+**type:** `boolean | string | { link?: string; label?: string }`
+
+Sostituisce l'[opzione globale `paginazione`](/it/reference/configuration/#pagination). Se viene specificata una stringa, il testo del collegamento generato verrà sostituito e se viene specificato un oggetto, sia il collegamento che il testo verranno sovrascritti.
+
+```md
+---
+# Nascondi il collegamento alla pagina precedente
+prev: false
+---
+```
+
+```md
+---
+# Sostituisci il testo del collegamento della pagina precedente
+prev: Continua il tutorial
+---
+```
+
+```md
+---
+# Sostituisci sia il collegamento che il testo della pagina precedente
+prev:
+ link: /pagina-non-correlata/
+ label: Dai un'occhiata a quest'altra pagina
+---
+```
+
+### `next`
+
+**type:** `boolean | string | { link?: string; label?: string }`
+
+Uguale a [`prev`](#prev) ma per il collegamento alla pagina successiva.
+
+```md
+---
+# Nascondi il collegamento alla pagina successiva
+next: false
+---
+```
+
+### `pagefind`
+
+**type:** `boolean`
+**default:** `true`
+
+Imposta se questa pagina deve essere inclusa nell'indice di ricerca [Pagefind](https://pagefind.app/). Imposta su `false` per escludere una pagina dai risultati di ricerca:
+
+```md
+---
+# Nascondi questa pagina dai risultati di ricerca
+pagefind: false
+---
+```
+
+### `sidebar`
+
+**type:** `{ label?: string; order?: number; hidden?: boolean; badge?: string | BadgeConfig }`
+
+Controlla il modo in cui questa pagina viene visualizzata nella [barra laterale](/it/reference/configuration/#sidebar), quando si utilizza un gruppo di collegamenti generato automaticamente.
+
+#### `label`
+
+**type:** `string`
+**default:** the page [`title`](#title-required)
+
+Imposta l'etichetta per questa pagina nella barra laterale quando viene visualizzata in un gruppo di collegamenti generato automaticamente.
+
+```md
+---
+title: Informazioni su questo progetto
+sidebar:
+ label: Informazioni
+---
+```
+
+#### `order`
+
+**type:** `number`
+
+Controlla l'ordine di questa pagina quando ordini un gruppo di collegamenti generato automaticamente.
+I numeri più bassi vengono visualizzati più in alto nel gruppo di collegamenti.
+
+```md
+---
+title: Pagina da visualizzare per prima
+sidebar:
+ order: 1
+---
+```
+
+#### `hidden`
+
+**type:** `boolean`
+**default:** `false`
+
+Impedisce che questa pagina venga inclusa in un gruppo della barra laterale generato automaticamente.
+
+```md
+---
+title: Pagina da nascondere dalla barra laterale generata automaticamente
+sidebar:
+ hidden: vero
+---
+```
+
+#### `badge`
+
+**type:** string | BadgeConfig
+
+Aggiungi un badge alla pagina nella barra laterale quando viene visualizzata in un gruppo di collegamenti generato automaticamente.
+Quando si utilizza una stringa, il badge verrà visualizzato con un colore in risalto predefinito.
+Facoltativamente, passa un [oggetto `BadgeConfig`](/it/reference/configuration/#badgeconfig) con i campi `text` e `variant` per personalizzare il badge.
+
+```md
+---
+title: Pagina con un badge
+sidebar:
+ # Utilizza la variante predefinita corrispondente al colore principale del tuo sito
+ badge: nuovo
+---
+```
+
+```md
+---
+title: Pagina con un badge
+sidebar:
+ badge:
+ text: Sperimentale
+ variant: caution
+---
+```
diff --git a/docs/src/content/docs/it/showcase.mdx b/docs/src/content/docs/it/showcase.mdx
new file mode 100644
index 00000000000..a3351f3f87c
--- /dev/null
+++ b/docs/src/content/docs/it/showcase.mdx
@@ -0,0 +1,53 @@
+---
+title: Vetrina Starlight
+description: Scopri i siti realizzati con Starlight e gli strumenti della community che estendono Starlight!
+---
+
+:::tip[Aggiungi il tuo!]
+Hai creato un sito Starlight o uno strumento per Starlight?
+Apri una PR aggiungendo un link a questa pagina!
+:::
+
+## Sites
+
+import ShowcaseSites from '../../../components/showcase-sites.astro';
+
+Starlight è già utilizzato nella produzione. Questi sono alcuni dei siti presenti sul web:
+
+
+
+Visualizza tutti i [repository di progetti pubblici che utilizzano Starlight su GitHub](https://github.com/withastro/starlight/network/dependents).
+
+## Community plugins
+
+import { CardGrid, LinkCard } from '@astrojs/starlight/components';
+
+Questi strumenti della community, plug-in e integrazioni lavorano insieme a Starlight per estenderne le funzionalità.
+
+
+
+
+
+
+
+
diff --git a/docs/src/content/docs/ja/guides/customization.mdx b/docs/src/content/docs/ja/guides/customization.mdx
index 5e113bf9f5c..fafe669206a 100644
--- a/docs/src/content/docs/ja/guides/customization.mdx
+++ b/docs/src/content/docs/ja/guides/customization.mdx
@@ -84,6 +84,19 @@ starlight({
}),
```
+## サイトマップを有効化する
+
+Starlightにはサイトマップ生成機能が組み込まれています。`astro.config.mjs`の`site`にURLを設定すると、サイトマップの生成が有効になります。
+
+```js
+// astro.config.mjs
+
+export default defineConfig({
+ site: 'https://stargazers.club',
+ integrations: [starlight({ title: 'サイトマップを設定したサイト' })],
+});
+```
+
## ページレイアウト
Starlightのページはデフォルトで、グローバルなナビゲーションサイドバーと、現在のページの見出しを表示する目次を配置したレイアウトを使用します。
diff --git a/docs/src/content/docs/ja/guides/i18n.mdx b/docs/src/content/docs/ja/guides/i18n.mdx
index 66d57cb9cc9..a7571086e52 100644
--- a/docs/src/content/docs/ja/guides/i18n.mdx
+++ b/docs/src/content/docs/ja/guides/i18n.mdx
@@ -141,7 +141,7 @@ Starlightは、すべての言語で同等のページが作成されること
Starlightでは、読者が選択した言語でサイト全体を体験できるように、翻訳されたコンテンツファイルをホストするだけでなく、デフォルトUIの文字列(たとえば目次に表示されている「目次」という見出し)も翻訳できるようになっています。
-英語、チェコ語、フランス語、ドイツ語、イタリア語、日本語、ポルトガル語、オランダ語、デンマーク語、スペイン語、トルコ語、アラビア語、ノルウェー語、ペルシア語、簡体字中国語、韓国語、スウェーデン語の翻訳済みUI文字列がすでに用意されていますが、[デフォルト言語をさらに追加するための貢献](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md)も歓迎します。
+英語、チェコ語、フランス語、ドイツ語、イタリア語、日本語、ポルトガル語、オランダ語、デンマーク語、スペイン語、トルコ語、アラビア語、ノルウェー語、ペルシア語、簡体字中国語、韓国語、ロシア語、スウェーデン語の翻訳済みUI文字列がすでに用意されていますが、[デフォルト言語をさらに追加するための貢献](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md)も歓迎します。
`18n`データコレクションを使用すると、サポートしたい言語の翻訳を追加したり、デフォルトのラベルを上書きしたりできます。
diff --git a/docs/src/content/docs/ja/reference/frontmatter.md b/docs/src/content/docs/ja/reference/frontmatter.md
index 56367ea651d..eb1aa6356a4 100644
--- a/docs/src/content/docs/ja/reference/frontmatter.md
+++ b/docs/src/content/docs/ja/reference/frontmatter.md
@@ -204,6 +204,20 @@ next: false
---
```
+### `pagefind`
+
+**type:** `boolean`
+**default:** `true`
+
+ページを[Pagefind](https://pagefind.app/)の検索インデックスに含めるかどうかを設定します。ページを検索結果から除外するには、`false`に設定します。
+
+```md
+---
+# このページを検索インデックスから外す
+pagefind: false
+---
+```
+
### `sidebar`
**type:** `{ label?: string; order?: number; hidden?: boolean; badge?: string | BadgeConfig }`
diff --git a/docs/src/content/docs/ja/showcase.mdx b/docs/src/content/docs/ja/showcase.mdx
index 18d24333ff6..68e1189b794 100644
--- a/docs/src/content/docs/ja/showcase.mdx
+++ b/docs/src/content/docs/ja/showcase.mdx
@@ -9,84 +9,11 @@ StarlightサイトやStarlightのツールを作成しましたか?このペ
## サイト
-import Card from '../../../components/showcase-card.astro';
-import FluidGrid from '../../../components/fluid-grid.astro';
+import ShowcaseSites from '../../../components/showcase-sites.astro';
Starlightはすでに本番環境で使用されています。以下はウェブ上のサイトの一部です。
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
[Starlightを使用しているGitHub上のすべてのパブリックプロジェクトのリポジトリ](https://github.com/withastro/starlight/network/dependents)も確認してください。
diff --git a/docs/src/content/docs/ko/guides/customization.mdx b/docs/src/content/docs/ko/guides/customization.mdx
index 68b4f2f8a2e..1414d587aff 100644
--- a/docs/src/content/docs/ko/guides/customization.mdx
+++ b/docs/src/content/docs/ko/guides/customization.mdx
@@ -84,6 +84,19 @@ starlight({
}),
```
+## 사이트맵 활성화
+
+Starlight에는 사이트맵 생성 기능이 내장되어 있습니다. `astro.config.mjs` 파일에 있는 `site` 속성의 값을 URL로 설정하여 사이트맵 생성을 활성화할 수 있습니다.
+
+```js
+// astro.config.mjs
+
+export default defineConfig({
+ site: 'https://stargazers.club',
+ integrations: [starlight({ title: '사이트맵을 사용하는 웹 사이트' })],
+});
+```
+
## 페이지 레이아웃
기본적으로 Starlight 페이지는 전역 탐색 사이드바와 현재 페이지 제목의 목차가 포함된 레이아웃을 사용합니다.
diff --git a/docs/src/content/docs/ko/guides/i18n.mdx b/docs/src/content/docs/ko/guides/i18n.mdx
index 234ff5c330c..a2556746e88 100644
--- a/docs/src/content/docs/ko/guides/i18n.mdx
+++ b/docs/src/content/docs/ko/guides/i18n.mdx
@@ -143,7 +143,7 @@ Starlight는 귀하가 모든 언어로 같은 페이지를 생성할 것을 기
Starlight를 사용하면 번역된 콘텐츠 파일을 호스팅하는 것 외에도 독자가 선택한 언어로 사이트 전체를 경험할 수 있도록 기본 UI 문자열(예를 들어, 목차의 제목인 "목차")을 번역할 수 있습니다.
-영어, 체코어, 프랑스어, 독일어, 이탈리아어, 일본어, 포르투갈어, 네덜란드어, 덴마크어, 스페인어, 터키어, 아랍어, 노르웨이어, 페르시아어, 중국어 간체, 한국어 및 스웨덴어로 번역된 UI 문자열이 기본적으로 제공됩니다. 그리고 우리는 [더 많은 기본 언어를 추가하는 데 기여](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md)하는걸 환영합니다.
+영어, 체코어, 프랑스어, 독일어, 이탈리아어, 일본어, 포르투갈어, 네덜란드어, 덴마크어, 스페인어, 터키어, 아랍어, 노르웨이어, 페르시아어, 히브리어, 중국어 간체, 한국어, 인도네시아어, 러시아어 및 스웨덴어로 번역된 UI 문자열이 기본적으로 제공됩니다. 그리고 우리는 [더 많은 기본 언어를 추가하는 데 기여](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md)하는걸 환영합니다.
`i18n` 데이터 컬렉션을 통해 지원하는 추가 언어에 대한 번역을 제공하거나 기본 라벨을 변경할 수 있습니다.
diff --git a/docs/src/content/docs/ko/guides/sidebar.mdx b/docs/src/content/docs/ko/guides/sidebar.mdx
new file mode 100644
index 00000000000..da8d5da39da
--- /dev/null
+++ b/docs/src/content/docs/ko/guides/sidebar.mdx
@@ -0,0 +1,473 @@
+---
+title: 사이드바 탐색
+description: Starlight 사이트의 사이드바 탐색 링크를 설정하고 사용자 정의하는 방법을 알아보세요.
+sidebar:
+ badge: New
+---
+
+import FileTree from '../../../../components/file-tree.astro';
+import SidebarPreview from '../../../../components/sidebar-preview.astro';
+
+잘 구성된 사이드바는 사용자가 사이트를 탐색하는 주요 방법 중 하나이므로 좋은 문서의 핵심입니다. Starlight는 사이드바 레이아웃과 콘텐츠를 변경할 수 있는 완전한 옵션 세트를 제공합니다.
+
+## 기본 사이드바
+
+기본적으로 Starlight는 각 파일의 `title` 속성을 사이드바 항목으로 사용하여 자동으로 문서의 파일 시스템 구조 기반의 사이드바를 생성합니다.
+
+예를 들어, 다음과 같은 파일 구조가 있다고 가정합니다.
+
+
+
+- src/
+ - content/
+ - docs/
+ - guides/
+ - components.md
+ - i18n.md
+ - reference/
+ - configuration.md
+
+
+
+다음 사이드바가 자동으로 생성됩니다.
+
+
+
+[자동 생성 그룹](#자동-생성-그룹) 섹션에서 자동으로 생성된 사이드바에 대해 자세히 알아보세요.
+
+## 링크 및 링크 그룹 추가
+
+`astro.config.mjs` 파일의 [`starlight.sidebar`](/ko/reference/configuration/#sidebar) 속성을 사용하여 사이드바 [링크](#링크) 및 [링크 그룹](#그룹) (접이식 헤더 및 하위 항목들)을 구성할 수 있습니다.
+
+링크와 그룹을 결합하여 다양한 사이드바 레이아웃을 만들 수 있습니다.
+
+### 링크
+
+`label` 및 `link` 속성이 있는 객체를 사용하여 내부 또는 외부 페이지에 대한 링크를 추가할 수 있습니다.
+
+```js
+starlight({
+ sidebar: [
+ // CSS 및 스타일링 가이드 링크
+ { label: 'CSS & 스타일링', link: '/ko/guides/css-and-tailwind/' },
+ // Astro 웹사이트로 연결되는 외부 링크
+ { label: 'Astro', link: 'https://astro.build/' },
+ ],
+});
+```
+
+위 구성은 다음 사이드바를 생성합니다.
+
+
+
+### 그룹
+
+접을 수 있는 제목 아래 관련 링크를 그룹화하여 사이드바에 구조를 추가할 수 있습니다. 그룹에는 링크와 기타 하위 그룹이 모두 포함될 수 있습니다.
+
+`label` 및 `items` 속성이 있는 객체를 사용하여 그룹을 추가합니다. `label`은 그룹의 제목으로 사용됩니다. `items` 배열에 링크나 하위 그룹을 추가할 수 있습니다.
+
+```js
+starlight({
+ sidebar: [
+ // "가이드" 라벨이 붙은 링크 그룹
+ {
+ label: '가이드',
+ items: [
+ { label: '컴포넌트', link: '/ko/guides/components/' },
+ { label: '국제화 (i18n)', link: '/ko/guides/i18n/' },
+ // 중첩된 링크 그룹
+ {
+ label: '스타일링',
+ items: [
+ { label: 'CSS', link: '/ko/guides/css-and-tailwind/' },
+ { label: 'Tailwind', link: '/ko/guides/css-and-tailwind/' },
+ { label: 'Shiki', link: '/ko/guides/css-and-tailwind/' },
+ ],
+ },
+ ],
+ },
+ ],
+});
+```
+
+위 구성은 다음 사이드바를 생성합니다.
+
+
+
+### 자동 생성 그룹
+
+Starlight는 문서 디렉토리를 기반해서 자동으로 사이드바에 그룹을 생성할 수 있습니다. 이는 그룹의 각 사이드바 항목을 수동으로 입력하고 싶지 않을 때 유용합니다. 기본적으로 페이지는 파일 이름을 알파벳순으로 정렬하여 사이드바에 표시합니다.
+
+`label` 및 `autogenerate` 속성이 있는 객체를 사용하여 자동 생성 그룹을 추가합니다. `autogenerate` 구성은 사이드바 항목에 사용할 디렉토리를 지정해야 합니다. 예를 들어, 다음 구성을 사용할 수 있습니다.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: '가이드',
+ // 'guides' 디렉토리에 대한 링크 그룹을 자동으로 생성
+ autogenerate: { directory: 'guides' },
+ },
+ ],
+});
+```
+
+파일 구조는 다음과 같습니다.
+
+
+
+- src/
+ - content/
+ - docs/
+ - guides/
+ - components.md
+ - i18n.md
+ - advanced/
+ - project-structure.md
+
+
+
+다음 사이드바가 생성됩니다:
+
+
+
+#### Frontmatter에서 자동으로 생성된 링크 변경하기
+
+자동으로 생성된 링크를 변경하려면 개별 페이지의 [`sidebar` frontmatter 필드](/ko/reference/frontmatter/#sidebar)를 사용하세요.
+
+frontmatter에서 sidebar 옵션을 사용하면 [사용자 정의 라벨](/ko/reference/frontmatter/#label)을 설정하거나 링크에 [배지](/ko/reference/frontmatter/#badge)를 추가하거나 사이드바에서 링크를 [숨기거나](/ko/reference/frontmatter/#hidden) [사용자 정의 정렬 기준](/ko/reference/frontmatter/#order)을 설정할 수 있습니다.
+
+```md
+---
+title: 나의 페이지
+sidebar:
+ # 링크에 대한 사용자 정의 라벨 설정
+ label: 사용자 정의 사이드바 라벨
+ # 링크에 대한 사용자 정의 순서 설정 (숫자가 낮을수록 더 위에 표시됩니다.)
+ order: 2
+ # 링크에 배지 추가
+ badge:
+ text: New
+ variant: tip
+---
+```
+
+위 frontmatter가 있는 페이지를 포함하는 자동 생성 그룹은 다음 사이드바를 생성합니다.
+
+
+
+:::note
+
+`sidebar` frontmatter 구성은 자동으로 생성된 링크에만 사용되며 수동으로 정의된 링크에서는 무시됩니다.
+
+:::
+
+## 배지
+
+링크 라벨 옆에 배지를 표시하기 위해 링크에는 `badge` 속성이 포함될 수도 있습니다.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: '가이드',
+ items: [
+ // "New" 배지가 포함된 링크
+ {
+ label: '컴포넌트',
+ link: '/ko/guides/components/',
+ badge: 'New',
+ },
+ ],
+ },
+ ],
+});
+```
+
+위 구성은 다음 사이드바를 생성합니다.
+
+
+
+### 배지 변형
+
+`text` 및 `variant` 속성이 있는 객체를 사용하여 배지 스타일을 변경할 수 있습니다.
+
+`text`는 표시할 콘텐츠를 나타냅니다(예: "New"). `variant` 속성의 값을 `note`, `tip`, `danger`, `caution`, `success` 중 하나로 설정하여 사이트의 강조 색상을 사용하는 `default` 스타일을 변경하세요.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: '가이드',
+ items: [
+ // 노란색 "실험적 기능" 배지가 포함된 링크
+ {
+ label: '컴포넌트',
+ link: '/ko/guides/components/',
+ badge: { text: '실험적 기능', variant: 'caution' },
+ },
+ ],
+ },
+ ],
+});
+```
+
+위 구성은 다음 사이드바를 생성합니다.
+
+
+
+## 국제화
+
+링크 또는 그룹의 라벨을 지원되는 각 언어로 번역하기 위해 링크 및 그룹 항목에 `translations` 속성을 사용할 수 있습니다.
+`label` 속성은 기본 언어 및 번역이 제공되지 않는 언어를 위해 사용될 것입니다.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: '가이드',
+ translations: {
+ es: 'Guías',
+ },
+ items: [
+ {
+ label: '컴포넌트',
+ translations: {
+ es: 'Componentes',
+ },
+ link: '/ko/guides/components/',
+ },
+ {
+ label: '국제화 (i18n)',
+ translations: {
+ es: 'Internacionalización (i18n)',
+ },
+ link: '/ko/guides/i18n/',
+ },
+ ],
+ },
+ ],
+});
+```
+
+스페인어로 문서를 검색하면 다음 사이드바가 생성됩니다.
+
+
+
+## 그룹 축소
+
+`collapsed` 속성을 `true`로 설정하면 링크 그룹의 기본 상태를 접힌 상태로 만들 수 있습니다.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: '가이드',
+ // 접힌 상태를 기본 상태로 설정
+ collapsed: true,
+ items: [
+ { label: '컴포넌트', link: '/ko/guides/components/' },
+ { label: '국제화 (i18n)', link: '/ko/guides/i18n/' },
+ ],
+ },
+ ],
+});
+```
+
+위 구성은 다음 사이드바를 생성합니다.
+
+
+
+[자동 생성 그룹](#자동-생성-그룹)은 상위 그룹의 `collapsed` 값을 따릅니다.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: '가이드',
+ // 그룹 및 자동으로 생성된 하위 그룹의 기본 상태가 접힌 상태가 됩니다.
+ collapsed: true,
+ autogenerate: { directory: 'guides' },
+ },
+ ],
+});
+```
+
+위 구성은 다음 사이드바를 생성합니다.
+
+
+
+`autogenerate.collapsed` 속성을 정의하여 이 동작을 변경할 수 있습니다.
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: '가이드',
+ // "가이드" 그룹은 축소하지 않고, 자동 생성된 하위 그룹을 축소합니다.
+ collapsed: false,
+ autogenerate: { directory: 'guides', collapsed: true },
+ },
+ ],
+});
+```
+
+위 구성은 다음 사이드바를 생성합니다.
+
+
diff --git a/docs/src/content/docs/ko/reference/frontmatter.md b/docs/src/content/docs/ko/reference/frontmatter.md
index 2c62b628bd1..eff787270a2 100644
--- a/docs/src/content/docs/ko/reference/frontmatter.md
+++ b/docs/src/content/docs/ko/reference/frontmatter.md
@@ -187,6 +187,20 @@ next: false
---
```
+### `pagefind`
+
+**타입:** `boolean`
+**기본값:** `true`
+
+이 페이지를 [Pagefind](https://pagefind.app/) 검색 색인에 포함할지 여부를 설정합니다. 검색 결과에서 페이지를 제외하려면 값을 `false`로 설정하세요.
+
+```md
+---
+# 검색 색인에서 이 페이지 숨기기
+pagefind: false
+---
+```
+
### `sidebar`
**타입:** `{ label?: string; order?: number; hidden?: boolean; badge?: string | BadgeConfig }`
diff --git a/docs/src/content/docs/ko/showcase.mdx b/docs/src/content/docs/ko/showcase.mdx
index 5c650a8fa6a..527bcd730de 100644
--- a/docs/src/content/docs/ko/showcase.mdx
+++ b/docs/src/content/docs/ko/showcase.mdx
@@ -12,84 +12,11 @@ Starlight 사이트나 Starlight용 도구를 만드셨나요?
## 사이트
-import Card from '../../../components/showcase-card.astro';
-import FluidGrid from '../../../components/fluid-grid.astro';
+import ShowcaseSites from '../../../components/showcase-sites.astro';
Starlight는 이미 프로덕션에 사용되고 있습니다. 다음은 웹사이트 중 일부입니다.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
GitHub에서 Starlight를 사용하는 [모든 공개 프로젝트 저장소](https://github.com/withastro/starlight/network/dependents)를 확인하세요.
diff --git a/docs/src/content/docs/pt-br/guides/customization.mdx b/docs/src/content/docs/pt-br/guides/customization.mdx
index 2c2c106ae63..55b30e78912 100644
--- a/docs/src/content/docs/pt-br/guides/customization.mdx
+++ b/docs/src/content/docs/pt-br/guides/customization.mdx
@@ -88,6 +88,19 @@ Você pode mostrar diferentes versões da sua logo no modo claro e escuro.
}),
```
+## Habilitar o sitemap
+
+O Starlight possui suporte integrado para a geração de um sitemap. Habilite a geração do sitemap definindo sua URL como `site` em `astro.config.mjs`:
+
+```js
+// astro.config.mjs
+
+export default defineConfig({
+ site: 'https://stargazers.club',
+ integrations: [starlight({ title: 'Site com sitemap' })],
+});
+```
+
## Layout da página
Por padrão, páginas do Starlight usam um layout com uma barra de navegação lateral global e um índice que mostra os cabeçalhos da página atual.
diff --git a/docs/src/content/docs/pt-br/reference/frontmatter.md b/docs/src/content/docs/pt-br/reference/frontmatter.md
index f3fc79eef8d..c03c527bf88 100644
--- a/docs/src/content/docs/pt-br/reference/frontmatter.md
+++ b/docs/src/content/docs/pt-br/reference/frontmatter.md
@@ -134,6 +134,25 @@ interface HeroConfig {
}
```
+### `banner`
+
+**tipo:** `{ content: string }`
+
+Exibe um banner de anúncio no topo desta página.
+
+O valor de `conteúdo` pode incluir HTML para links ou outro conteúdo.
+Por exemplo, esta página exibe um banner que inclui um link para `example.com`.
+
+```md
+---
+title: Página com um banner
+banner:
+ content: |
+ Acabamos de lançar algo legal!
+ Confira
+---
+```
+
### `lastUpdated`
**tipo:** `Date | boolean`
diff --git a/docs/src/content/docs/pt-br/showcase.mdx b/docs/src/content/docs/pt-br/showcase.mdx
index 55c3e022541..abb8b6c1c82 100644
--- a/docs/src/content/docs/pt-br/showcase.mdx
+++ b/docs/src/content/docs/pt-br/showcase.mdx
@@ -10,84 +10,11 @@ Abra um PR adicionando um link a esta página!
## Sites
-import Card from '../../../components/showcase-card.astro';
-import FluidGrid from '../../../components/fluid-grid.astro';
+import ShowcaseSites from '../../../components/showcase-sites.astro';
Starlight já está sendo utilizado em produção. Esses são alguns dos sites através da web:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
Veja todos os [repositórios de projetos públicos utilizando Starlight no GitHub](https://github.com/withastro/starlight/network/dependents).
diff --git a/docs/src/content/docs/reference/frontmatter.md b/docs/src/content/docs/reference/frontmatter.md
index 7ceb8344927..7b30541165f 100644
--- a/docs/src/content/docs/reference/frontmatter.md
+++ b/docs/src/content/docs/reference/frontmatter.md
@@ -208,6 +208,20 @@ next: false
---
```
+### `pagefind`
+
+**type:** `boolean`
+**default:** `true`
+
+Set whether this page should be included in the [Pagefind](https://pagefind.app/) search index. Set to `false` to exclude a page from search results:
+
+```md
+---
+# Hide this page from the search index
+pagefind: false
+---
+```
+
### `sidebar`
**type:** `{ label?: string; order?: number; hidden?: boolean; badge?: string | BadgeConfig }`
@@ -246,7 +260,7 @@ sidebar:
#### `hidden`
-**type:** `boolean`
+**type:** `boolean`
**default:** `false`
Prevents this page from being included in an autogenerated sidebar group.
diff --git a/docs/src/content/docs/showcase.mdx b/docs/src/content/docs/showcase.mdx
index 243ec5dd673..194caafdfe8 100644
--- a/docs/src/content/docs/showcase.mdx
+++ b/docs/src/content/docs/showcase.mdx
@@ -10,84 +10,11 @@ Open a PR adding a link to this page!
## Sites
-import Card from '../../components/showcase-card.astro';
-import FluidGrid from '../../components/fluid-grid.astro';
+import ShowcaseSites from '../../components/showcase-sites.astro';
Starlight is already being used in production. These are some of the sites around the web:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
See all the [public project repos using Starlight on GitHub](https://github.com/withastro/starlight/network/dependents).
diff --git a/docs/src/content/docs/zh/guides/customization.mdx b/docs/src/content/docs/zh/guides/customization.mdx
index d6525432bd3..3eebca3a148 100644
--- a/docs/src/content/docs/zh/guides/customization.mdx
+++ b/docs/src/content/docs/zh/guides/customization.mdx
@@ -87,6 +87,18 @@ starlight({
}),
```
+## 启用 sitemap
+
+Starlight 内置了生成站点地图(sitemap)的支持。通过在 `astro.config.mjs` 中把 `site` 字段设置为你的 URL 来启用站点地图生成:
+
+```js
+// astro.config.mjs
+export default defineConfig({
+ site: 'https://stargazers.club',
+ integrations: [starlight({ title: 'Site with sitemap' })],
+});
+```
+
## 页面布局
默认情况下,Starlight 页面使用带有全局导航侧边栏和显示当前页面标题的目录的布局。
diff --git a/docs/src/content/docs/zh/guides/i18n.mdx b/docs/src/content/docs/zh/guides/i18n.mdx
index 0784813f78c..52134d82c13 100644
--- a/docs/src/content/docs/zh/guides/i18n.mdx
+++ b/docs/src/content/docs/zh/guides/i18n.mdx
@@ -142,7 +142,7 @@ Starlight 期望你在所有语言中创建等效的页面。例如,如果你
除了托管翻译的内容文件之外,Starlight 还允许你翻译默认的 UI 字符串(例如,目录中的“本页”标题),以便你的读者可以完全使用所选的语言体验你的网站。
-默认提供了英语、捷克语、法语、德语、意大利语、日语、葡萄牙语、荷兰语、丹麦语、西班牙语、土耳其语、阿拉伯语、挪威语、波斯语、简体中文、韩语和瑞典语的翻译 UI 字符串,我们欢迎[贡献添加更多默认语言](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md)。
+默认提供了英语、捷克语、法语、德语、意大利语、日语、葡萄牙语、荷兰语、丹麦语、西班牙语、土耳其语、阿拉伯语、挪威语、波斯语、希伯来语、简体中文、韩语、印度尼西亚语、俄罗斯语和瑞典语的翻译 UI 字符串,我们欢迎[贡献添加更多默认语言](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md)。
你可以通过 `i18n` 数据集合提供你支持的其他语言的翻译 - 或覆盖我们的默认标签。
diff --git a/docs/src/content/docs/zh/guides/sidebar.mdx b/docs/src/content/docs/zh/guides/sidebar.mdx
new file mode 100644
index 00000000000..13a9d1a57c8
--- /dev/null
+++ b/docs/src/content/docs/zh/guides/sidebar.mdx
@@ -0,0 +1,471 @@
+---
+title: 侧边栏导航
+description: 了解如何设置和自定义 Starlight 站点的侧边栏导航链接。
+sidebar:
+ badge: New
+---
+
+import FileTree from '../../../../components/file-tree.astro';
+import SidebarPreview from '../../../../components/sidebar-preview.astro';
+
+一个组织良好的侧边栏是良好文档的关键,因为它是用户浏览你的站点的主要方式之一。Starlight 提供了一整套选项来自定义侧边栏布局和内容。
+
+## 默认侧边栏
+
+默认情况查下,Starlight 会根据你的文档文件系统结构自动生成侧边栏,使用每个文件的 `title` 属性作为侧边栏条目。
+
+例如,给定以下文件结构:
+
+
+
+- src/
+ - content/
+ - docs/
+ - guides/
+ - components.md
+ - i18n.md
+ - reference/
+ - configuration.md
+
+
+
+将会自动生成以下侧边栏:
+
+
+
+在 [自动生成的分组](#自动生成的分组) 章节了解更多关于自动生成侧边栏的内容。
+
+## 添加链接和链接分组
+
+要配置侧边栏 [链接](#链接) 和 [链接分组](#分组)(在可折叠的标题中),请在 `astro.config.mjs` 中使用 [`starlight.sidebar`](/zh/reference/configuration/#sidebar) 属性。
+
+结合使用链接和链接分组,你可以创建各种侧边栏布局。
+
+### 链接
+
+使用具有 `label` 和 `link` 属性的对象添加一个指向内部或外部页面的链接。
+
+```js
+starlight({
+ sidebar: [
+ // 指向 CSS & Styling 指南的链接
+ { label: 'CSS & Styling', link: '/zh/guides/css-and-tailwind/' },
+ // 指向 Astro 官网的外部链接
+ { label: 'Astro', link: 'https://astro.build/' },
+ ],
+});
+```
+
+上面的配置生成以下侧边栏:
+
+
+
+### 分组
+
+你可以通过在可折叠的标题下将相关链接组合在一起来为侧边栏添加结构。
+分组可以包含链接和其他子组。
+
+使用具有 `label` 和 `items` 属性的对象添加一个分组。
+`label` 将用作分组的标题。
+将链接或子组添加到 `items` 数组中。
+
+```js
+starlight({
+ sidebar: [
+ // 一个名为 "Guides" 的链接分组
+ {
+ label: 'Guides',
+ items: [
+ { label: 'Components', link: '/guides/components/' },
+ { label: 'Internationalization (i18n)', link: '/guides/i18n/' },
+ // 一个嵌套的链接分组
+ {
+ label: 'Styling',
+ items: [
+ { label: 'CSS', link: '/guides/css-and-tailwind/' },
+ { label: 'Tailwind', link: '/guides/css-and-tailwind/' },
+ { label: 'Shiki', link: '/guides/css-and-tailwind/' },
+ ],
+ },
+ ],
+ },
+ ],
+});
+```
+
+上面的配置生成以下侧边栏:
+
+
+
+### 自动生成的分组
+
+Starlight 可以根据文档目录在侧边栏中自动生成一个分组。当你不想手动输入分组中的每个侧边栏项目时,这很有用。默认情况下,页面将按文档名的字母顺序排序。
+
+使用具有 `label` 和 `autogenerate` 属性的对象添加自动生成的分组。`autogenerate` 的配置必须指定用于侧边栏条目的 `directory` 。例如,使用以下配置:
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guides',
+ // 自动生成一个链接分组,用于 'guides' 目录。
+ autogenerate: { directory: 'guides' },
+ },
+ ],
+});
+```
+
+给定以下文件结构:
+
+
+
+- src/
+ - content/
+ - docs/
+ - guides/
+ - components.md
+ - i18n.md
+ - advanced/
+ - project-structure.md
+
+
+
+将会自动生成以下侧边栏:
+
+
+
+#### 在 frontmatter 中自定义自动生成的链接
+
+在单个页面中使用 [`sidebar` frontmatter 字段](/zh/reference/frontmatter/#sidebar) 来自定义自动生成的链接。
+
+侧边栏 frontmatter 选项允许你设置 [自定义标签](/zh/reference/frontmatter/#label) 或者为链接添加 [徽章](/zh/reference/frontmatter/#badge),[隐藏](/zh/reference/frontmatter/#hidden) 侧边栏中的链接,或者定义 [自定义排序权重](/zh/reference/frontmatter/#order)。
+
+```md
+---
+title: 我的页面
+sidebar:
+ # 为链接设置自定义标签
+ label: 自定义侧边栏 label
+ # 为链接设置自定义顺序(数字越小显示在上方)
+ order: 2
+ # 为链接添加徽章
+ badge:
+ text: New
+ variant: tip
+---
+```
+
+一个包含上面 frontmatter 的页面的自动生成分组将会生成以下侧边栏:
+
+
+
+:::note
+`sidebar` frontmatter 配置仅用于自动生成的链接,对于手动定义的链接将被忽略。
+:::
+
+## 徽章
+
+链接也可以包含一个 `badge` 属性,以在链接标签旁边显示徽章。
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guides',
+ items: [
+ // 带有 "New" 徽章的链接。
+ {
+ label: 'Components',
+ link: '/guides/components/',
+ badge: 'New',
+ },
+ ],
+ },
+ ],
+});
+```
+
+以上配置将生成以下侧边栏:
+
+
+
+### 徽章种类
+
+使用具有 `text` 和 `variant` 属性的对象自定义徽章样式。
+
+`text` 属性表示要显示的内容(例如 "New")。
+通过将 `variant` 属性设置为以下值之一:`note`、`tip`、`danger`、`caution` 或 `success`,可以覆盖 `default` 样式,默认样式使用你的网站的强调色。
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guides',
+ items: [
+ // 一个带有黄色 "Experimental" 徽章的链接。
+ {
+ label: 'Components',
+ link: '/guides/components/',
+ badge: { text: 'Experimental', variant: 'caution' },
+ },
+ ],
+ },
+ ],
+});
+```
+
+以上配置将生成以下侧边栏:
+
+
+
+## 国际化
+
+使用链接和分组条目上的 `translations` 属性为每种支持的语言翻译链接或分组标签。
+`label` 属性将用于默认语言和没有翻译的语言。
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guides',
+ translations: {
+ zh: '指南',
+ },
+ items: [
+ {
+ label: 'Components',
+ translations: {
+ zh: '组件',
+ },
+ link: '/zh/guides/components/',
+ },
+ {
+ label: 'Internationalization (i18n)',
+ translations: {
+ zh: '国际化 (i18n)',
+ },
+ link: '/zh/guides/i18n/',
+ },
+ ],
+ },
+ ],
+});
+```
+
+浏览简体中文文档将生成以下侧边栏:
+
+
+
+## 折叠分组
+
+链接分组可以通过将 `collapsed` 属性设置为 `true` 来默认折叠。
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guides',
+ // 默认折叠分组
+ collapsed: true,
+ items: [
+ { label: 'Components', link: '/guides/components/' },
+ { label: 'Internationalization (i18n)', link: '/guides/i18n/' },
+ ],
+ },
+ ],
+});
+```
+
+以上配置将生成以下侧边栏:
+
+
+
+[自动生成的分组](#自动生成的分组) 遵循其父级分组的 `collapsed` 值:
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guides',
+ // 默认折叠分组及其自动生成的子组。
+ collapsed: true,
+ autogenerate: { directory: 'guides' },
+ },
+ ],
+});
+```
+
+以上配置将生成以下侧边栏:
+
+
+
+这个行为可以通过定义 `autogenerate.collapsed` 属性来覆盖。
+
+```js
+starlight({
+ sidebar: [
+ {
+ label: 'Guides',
+ // 不折叠 "Guides" 分组,但折叠其自动生成的子组。
+ collapsed: false,
+ autogenerate: { directory: 'guides', collapsed: true },
+ },
+ ],
+});
+```
+
+以上配置将生成以下侧边栏:
+
+
diff --git a/docs/src/content/docs/zh/reference/frontmatter.md b/docs/src/content/docs/zh/reference/frontmatter.md
index 5e42d63b2ac..313ae94a72a 100644
--- a/docs/src/content/docs/zh/reference/frontmatter.md
+++ b/docs/src/content/docs/zh/reference/frontmatter.md
@@ -208,6 +208,20 @@ next: false
---
```
+### `pagefind`
+
+**类型:** `boolean`
+**默认值:** `true`
+
+设置此页面是否应包含在 [Pagefind](https://pagefind.app/) 搜索索引中。设置为 `false` 以从搜索结果中排除页面:
+
+```md
+---
+# 在搜索索引中隐藏此页面
+pagefind: false
+---
+```
+
### `sidebar`
**类型:** `{ label?: string; order?: number; hidden?: boolean; badge?: string | BadgeConfig }`
diff --git a/docs/src/content/docs/zh/showcase.mdx b/docs/src/content/docs/zh/showcase.mdx
index 4764884e5f2..57d09216ae1 100644
--- a/docs/src/content/docs/zh/showcase.mdx
+++ b/docs/src/content/docs/zh/showcase.mdx
@@ -9,84 +9,11 @@ description: 发现使用 Starlight 构建的网站和扩展 Starlight 的社区
## 网站
-import Card from '../../../components/showcase-card.astro';
-import FluidGrid from '../../../components/fluid-grid.astro';
+import ShowcaseSites from '../../../components/showcase-sites.astro';
Starlight 已投入生产。 这些是网络上的一些网站:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
查看所有[在 GitHub 上使用 Starlight 的公共项目仓库](https://github.com/withastro/starlight/network/dependents)。
diff --git a/examples/basics/README.md b/examples/basics/README.md
index 37dfc32baa4..f95661b59b0 100644
--- a/examples/basics/README.md
+++ b/examples/basics/README.md
@@ -1,5 +1,7 @@
# Starlight Starter Kit: Basics
+[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)
+
```
npm create astro@latest -- --template starlight
```
diff --git a/examples/basics/astro.config.mjs b/examples/basics/astro.config.mjs
index 3aea6d67fc6..9eacfd175f4 100644
--- a/examples/basics/astro.config.mjs
+++ b/examples/basics/astro.config.mjs
@@ -24,7 +24,4 @@ export default defineConfig({
],
}),
],
-
- // Process images with sharp: https://docs.astro.build/en/guides/assets/#using-sharp
- image: { service: { entrypoint: 'astro/assets/services/sharp' } },
});
diff --git a/examples/basics/package.json b/examples/basics/package.json
index 0fde2747d65..9d7d5c6a981 100644
--- a/examples/basics/package.json
+++ b/examples/basics/package.json
@@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
- "@astrojs/starlight": "^0.9.0",
+ "@astrojs/starlight": "^0.10.2",
"astro": "^3.0.6",
"sharp": "^0.32.5"
}
diff --git a/examples/tailwind/README.md b/examples/tailwind/README.md
index 18ed8080dd6..97352ede18a 100644
--- a/examples/tailwind/README.md
+++ b/examples/tailwind/README.md
@@ -1,5 +1,7 @@
# Starlight Starter Kit: Tailwind
+[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)
+
```
npm create astro@latest -- --template starlight/tailwind
```
diff --git a/examples/tailwind/astro.config.mjs b/examples/tailwind/astro.config.mjs
index 63a3af18ae4..99448763e81 100644
--- a/examples/tailwind/astro.config.mjs
+++ b/examples/tailwind/astro.config.mjs
@@ -27,10 +27,4 @@ export default defineConfig({
}),
tailwind({ applyBaseStyles: false }),
],
- // Process images with sharp: https://docs.astro.build/en/guides/assets/#using-sharp
- image: {
- service: {
- entrypoint: 'astro/assets/services/sharp',
- },
- },
});
diff --git a/examples/tailwind/package.json b/examples/tailwind/package.json
index 65660f086d2..4dee1f36857 100644
--- a/examples/tailwind/package.json
+++ b/examples/tailwind/package.json
@@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
- "@astrojs/starlight": "^0.9.0",
+ "@astrojs/starlight": "^0.10.2",
"@astrojs/starlight-tailwind": "^2.0.0",
"@astrojs/tailwind": "^5.0.0",
"astro": "^3.0.6",
diff --git a/package.json b/package.json
index 434b9eee2ab..989f4f34808 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
"version": "1.0.0",
"description": "",
"scripts": {
- "build:examples": "pnpm --filter @example/* build",
+ "build:examples": "pnpm --filter '@example/*' build",
"size": "size-limit",
"version": "pnpm changeset version && pnpm i --no-frozen-lockfile",
"format": "prettier -w --cache --plugin prettier-plugin-astro ."
@@ -19,7 +19,7 @@
"prettier-plugin-astro": "^0.11.0",
"size-limit": "^8.2.4"
},
- "packageManager": "pnpm@8.2.0",
+ "packageManager": "pnpm@8.7.4",
"size-limit": [
{
"name": "/index.html",
diff --git a/packages/starlight/CHANGELOG.md b/packages/starlight/CHANGELOG.md
index 23bc3662958..3f076bbf632 100644
--- a/packages/starlight/CHANGELOG.md
+++ b/packages/starlight/CHANGELOG.md
@@ -1,5 +1,53 @@
# @astrojs/starlight
+## 0.10.2
+
+### Patch Changes
+
+- [#735](https://github.com/withastro/starlight/pull/735) [`2da8692`](https://github.com/withastro/starlight/commit/2da86929c8041f6585790c3baf1cba42220650cc) Thanks [@delucis](https://github.com/delucis)! - Use Starlight font custom property in Pagefind modal
+
+- [#735](https://github.com/withastro/starlight/pull/735) [`2da8692`](https://github.com/withastro/starlight/commit/2da86929c8041f6585790c3baf1cba42220650cc) Thanks [@delucis](https://github.com/delucis)! - Fix RTL styling in Pagefind modal
+
+- [#739](https://github.com/withastro/starlight/pull/739) [`a9de4a7`](https://github.com/withastro/starlight/commit/a9de4a7dcf9ec8c5c801e8a6cbb0d7faf2c34db7) Thanks [@radenpioneer](https://github.com/radenpioneer)! - Add Indonesian UI translation
+
+- [#747](https://github.com/withastro/starlight/pull/747) [`7589515`](https://github.com/withastro/starlight/commit/75895154b11cf9368d4d6b45647b156ce32a88f0) Thanks [@nirtamir2](https://github.com/nirtamir2)! - Add Hebrew UI translations
+
+## 0.10.1
+
+### Patch Changes
+
+- [#726](https://github.com/withastro/starlight/pull/726) [`f3157c6`](https://github.com/withastro/starlight/commit/f3157c6065943af39995b6dbae5f63cf424bd9a3) Thanks [@delucis](https://github.com/delucis)! - Fix a rare bug in table of contents when handling headings that increase by more than one level on a page.
+
+- [#729](https://github.com/withastro/starlight/pull/729) [`80c6ab1`](https://github.com/withastro/starlight/commit/80c6ab1c1ec48805e74c53b615a78d65127eeacb) Thanks [@delucis](https://github.com/delucis)! - Upgrade Pagefind to v1.0.3
+
+- [#715](https://github.com/withastro/starlight/pull/715) [`e726155`](https://github.com/withastro/starlight/commit/e7261559f2539a0ceefd36a28e4fbbc17f5970b8) Thanks [@itsmatteomanf](https://github.com/itsmatteomanf)! - feat: prevent scroll on body when search is open
+
+## 0.10.0
+
+### Minor Changes
+
+- [#692](https://github.com/withastro/starlight/pull/692) [`2a58e1a`](https://github.com/withastro/starlight/commit/2a58e1aa068d01833a0ab9e74e4b46cccaee1775) Thanks [@delucis](https://github.com/delucis)! - Upgrade Pagefind to v1 and display page headings in search results
+
+### Patch Changes
+
+- [#708](https://github.com/withastro/starlight/pull/708) [`136cfb1`](https://github.com/withastro/starlight/commit/136cfb180f22db116cfdb62fd93d21daff596946) Thanks [@julien-deramond](https://github.com/julien-deramond)! - Fix main content column width for pages without a table of contents
+
+- [#682](https://github.com/withastro/starlight/pull/682) [`660a5f5`](https://github.com/withastro/starlight/commit/660a5f57adf0340de21df3e364aada38255bb06c) Thanks [@vedmalex](https://github.com/vedmalex)! - Add Russian language support
+
+## 0.9.1
+
+### Patch Changes
+
+- [#647](https://github.com/withastro/starlight/pull/647) [`ea57726`](https://github.com/withastro/starlight/commit/ea5772655274a3900310cb700836fdd2f6dba7cd) Thanks [@bgmort](https://github.com/bgmort)! - Fix translated 404 pages not being excluded from search results
+
+- [#667](https://github.com/withastro/starlight/pull/667) [`9828f73`](https://github.com/withastro/starlight/commit/9828f739b73e2f377c1450b9e11f0914722ee440) Thanks [@delucis](https://github.com/delucis)! - Break inline `` across lines to avoid overflow
+
+- [#642](https://github.com/withastro/starlight/pull/642) [`e623d92`](https://github.com/withastro/starlight/commit/e623d92c2fddc0ff5fe83d2554266885d683a906) Thanks [@fk](https://github.com/fk)! - Don't hard-code nav height in table of contents highlighting script
+
+- [#676](https://github.com/withastro/starlight/pull/676) [`6419006`](https://github.com/withastro/starlight/commit/641900615aa9a9a128d6934e65a57ba89e503cfd) Thanks [@vedmalex](https://github.com/vedmalex)! - Upgrade and pin Pagefind to latest beta release.
+
+- [#647](https://github.com/withastro/starlight/pull/647) [`ea57726`](https://github.com/withastro/starlight/commit/ea5772655274a3900310cb700836fdd2f6dba7cd) Thanks [@bgmort](https://github.com/bgmort)! - Add frontmatter option to exclude a page from Pagefind search results
+
## 0.9.0
### Minor Changes
diff --git a/packages/starlight/__tests__/basics/toc.test.ts b/packages/starlight/__tests__/basics/toc.test.ts
new file mode 100644
index 00000000000..51745d7b81c
--- /dev/null
+++ b/packages/starlight/__tests__/basics/toc.test.ts
@@ -0,0 +1,141 @@
+import { expect, test } from 'vitest';
+import { generateToC } from '../../components/TableOfContents/generateToC';
+
+const defaultOpts = { minHeadingLevel: 2, maxHeadingLevel: 3, title: 'Overview' };
+
+test('generates an overview entry with no headings available', () => {
+ const toc = generateToC([], defaultOpts);
+ expect(toc).toHaveLength(1);
+ expect(toc[0]).toEqual({ children: [], depth: 2, slug: '_top', text: 'Overview' });
+});
+
+test('generates entries from heading array', () => {
+ const toc = generateToC([{ text: 'One', slug: 'one', depth: 2 }], defaultOpts);
+ expect(toc).toHaveLength(2);
+ expect(toc[0]).toEqual({ children: [], depth: 2, slug: '_top', text: 'Overview' });
+ expect(toc[1]).toEqual({ children: [], depth: 2, slug: 'one', text: 'One' });
+});
+
+test('nests lower-level headings in children array h2 => h3', () => {
+ const toc = generateToC(
+ [
+ { text: 'One', slug: 'one', depth: 2 },
+ { text: 'Two', slug: 'two', depth: 3 },
+ ],
+ defaultOpts
+ );
+ expect(toc).toHaveLength(2);
+ expect(toc[0]).toEqual({ children: [], depth: 2, slug: '_top', text: 'Overview' });
+ expect(toc[1]).toEqual({
+ children: [{ children: [], depth: 3, slug: 'two', text: 'Two' }],
+ depth: 2,
+ slug: 'one',
+ text: 'One',
+ });
+});
+
+test('nests lower-level headings in children array h2 => h4', () => {
+ const toc = generateToC(
+ [
+ { text: 'One', slug: 'one', depth: 2 },
+ { text: 'Two', slug: 'two', depth: 4 },
+ ],
+ { ...defaultOpts, maxHeadingLevel: 6 }
+ );
+ expect(toc).toHaveLength(2);
+ expect(toc[0]).toEqual({ children: [], depth: 2, slug: '_top', text: 'Overview' });
+ expect(toc[1]).toEqual({
+ children: [{ children: [], depth: 4, slug: 'two', text: 'Two' }],
+ depth: 2,
+ slug: 'one',
+ text: 'One',
+ });
+});
+
+test('nests lower-level headings deeply h2 => h4 => h6', () => {
+ const toc = generateToC(
+ [
+ { text: 'One', slug: 'one', depth: 2 },
+ { text: 'Two', slug: 'two', depth: 4 },
+ { text: 'Three', slug: 'three', depth: 6 },
+ ],
+ { ...defaultOpts, maxHeadingLevel: 6 }
+ );
+ expect(toc).toHaveLength(2);
+ expect(toc[0]).toEqual({ children: [], depth: 2, slug: '_top', text: 'Overview' });
+ expect(toc[1]).toMatchInlineSnapshot(`
+ {
+ "children": [
+ {
+ "children": [
+ {
+ "children": [],
+ "depth": 6,
+ "slug": "three",
+ "text": "Three",
+ },
+ ],
+ "depth": 4,
+ "slug": "two",
+ "text": "Two",
+ },
+ ],
+ "depth": 2,
+ "slug": "one",
+ "text": "One",
+ }
+ `);
+});
+
+test('adds higher-level headings sequentially h6 => h4 => h2', () => {
+ const toc = generateToC(
+ [
+ { text: 'One', slug: 'one', depth: 6 },
+ { text: 'Two', slug: 'two', depth: 4 },
+ { text: 'Three', slug: 'three', depth: 2 },
+ ],
+ { ...defaultOpts, maxHeadingLevel: 6 }
+ );
+ expect(toc).toHaveLength(2);
+ expect(toc).toMatchInlineSnapshot(`
+ [
+ {
+ "children": [
+ {
+ "children": [],
+ "depth": 6,
+ "slug": "one",
+ "text": "One",
+ },
+ {
+ "children": [],
+ "depth": 4,
+ "slug": "two",
+ "text": "Two",
+ },
+ ],
+ "depth": 2,
+ "slug": "_top",
+ "text": "Overview",
+ },
+ {
+ "children": [],
+ "depth": 2,
+ "slug": "three",
+ "text": "Three",
+ },
+ ]
+ `);
+});
+
+test('filters out higher-level headings than minHeadingLevel', () => {
+ const toc = generateToC([{ text: 'One', slug: 'one', depth: 1 }], defaultOpts);
+ expect(toc).toHaveLength(1);
+ expect(toc[0]).toEqual({ children: [], depth: 2, slug: '_top', text: 'Overview' });
+});
+
+test('filters out lower-level headings than maxHeadingLevel', () => {
+ const toc = generateToC([{ text: 'One', slug: 'one', depth: 4 }], defaultOpts);
+ expect(toc).toHaveLength(1);
+ expect(toc[0]).toEqual({ children: [], depth: 2, slug: '_top', text: 'Overview' });
+});
diff --git a/packages/starlight/components/Search.astro b/packages/starlight/components/Search.astro
index be8997a8ad7..89c2bed0e9b 100644
--- a/packages/starlight/components/Search.astro
+++ b/packages/starlight/components/Search.astro
@@ -58,31 +58,37 @@ const pagefindTranslations = {
const dialog = this.querySelector('dialog')!;
const dialogFrame = this.querySelector('.dialog-frame')!;
- /** Close the modal if a user clicks outside of the modal. */
- const onWindowClick = (event: MouseEvent) => {
+ /** Close the modal if a user clicks on a link or outside of the modal. */
+ const onClick = (event: MouseEvent) => {
+ const isLink = 'href' in (event.target || {});
if (
- document.body.contains(event.target as Node) &&
- !dialogFrame.contains(event.target as Node)
- )
+ isLink ||
+ (document.body.contains(event.target as Node) &&
+ !dialogFrame.contains(event.target as Node))
+ ) {
closeModal();
+ }
};
const openModal = (event?: MouseEvent) => {
dialog.showModal();
+ document.body.toggleAttribute('data-search-modal-open', true);
this.querySelector('input')?.focus();
event?.stopPropagation();
- window.addEventListener('click', onWindowClick);
+ window.addEventListener('click', onClick);
};
- const closeModal = () => {
- dialog.close();
- window.removeEventListener('click', onWindowClick);
- };
+ const closeModal = () => dialog.close();
openBtn.addEventListener('click', openModal);
openBtn.disabled = false;
closeBtn.addEventListener('click', closeModal);
+ dialog.addEventListener('close', () => {
+ document.body.toggleAttribute('data-search-modal-open', false);
+ window.removeEventListener('click', onClick);
+ });
+
// Listen for `/` and `cmd + k` keyboard shortcuts.
window.addEventListener('keydown', (e) => {
const isInput =
@@ -110,9 +116,10 @@ const pagefindTranslations = {
new PagefindUI({
element: '#starlight__search',
baseUrl: import.meta.env.BASE_URL,
- bundlePath: import.meta.env.BASE_URL.replace(/\/$/, '') + '/_pagefind/',
+ bundlePath: import.meta.env.BASE_URL.replace(/\/$/, '') + '/pagefind/',
showImages: false,
translations,
+ showSubResults: true,
});
});
});
@@ -179,7 +186,7 @@ const pagefindTranslations = {
.dialog-frame {
flex-direction: column;
gap: 1rem;
- padding: 1.5rem;
+ padding: 1rem;
}
button[data-close-modal] {
@@ -198,6 +205,7 @@ const pagefindTranslations = {
#starlight__search {
--pagefind-ui-primary: var(--sl-color-accent-light);
--pagefind-ui-text: var(--sl-color-gray-2);
+ --pagefind-ui-font: var(--__sl-font);
--pagefind-ui-background: var(--sl-color-black);
--pagefind-ui-border: var(--sl-color-gray-5);
--pagefind-ui-border-width: 1px;
@@ -218,10 +226,35 @@ const pagefindTranslations = {
min-height: 15rem;
max-height: calc(100% - 8rem);
}
+
+ .dialog-frame {
+ padding: 1.5rem;
+ }
}
diff --git a/packages/starlight/components/TableOfContents/MobileTableOfContents.astro b/packages/starlight/components/TableOfContents/MobileTableOfContents.astro
index b4fc200021a..34fe1d5e19a 100644
--- a/packages/starlight/components/TableOfContents/MobileTableOfContents.astro
+++ b/packages/starlight/components/TableOfContents/MobileTableOfContents.astro
@@ -122,7 +122,7 @@ const t = useTranslations(locale);
}
constructor() {
- super({ smallViewport: true });
+ super();
const details = this.querySelector('details');
if (!details) return;
const closeToC = () => {
diff --git a/packages/starlight/components/TableOfContents/generateToC.ts b/packages/starlight/components/TableOfContents/generateToC.ts
index 30d1005fe08..73c08e3d472 100644
--- a/packages/starlight/components/TableOfContents/generateToC.ts
+++ b/packages/starlight/components/TableOfContents/generateToC.ts
@@ -4,52 +4,29 @@ export interface TocItem extends MarkdownHeading {
children: TocItem[];
}
-function diveChildren(item: TocItem, depth: number): TocItem[] {
- if (depth === 1) {
- return item.children;
- } else if (item.children.length > 0) {
- return diveChildren(item.children.at(-1)!, depth - 1);
- } else {
- return [];
- }
-}
-
interface TocOpts {
minHeadingLevel: number;
maxHeadingLevel: number;
- title?: string;
+ title: string;
}
+/** Convert the flat headings array generated by Astro into a nested tree structure. */
export function generateToC(
headings: MarkdownHeading[],
- { minHeadingLevel, maxHeadingLevel, title = 'Overview' }: TocOpts
+ { minHeadingLevel, maxHeadingLevel, title }: TocOpts
) {
- const overview = { depth: 2, slug: '_top', text: title };
- headings = [
- overview,
- ...headings.filter(({ depth }) => depth >= minHeadingLevel && depth <= maxHeadingLevel),
- ];
- const toc: Array = [];
+ headings = headings.filter(({ depth }) => depth >= minHeadingLevel && depth <= maxHeadingLevel);
+ const toc: Array = [{ depth: 2, slug: '_top', text: title, children: [] }];
+ for (const heading of headings) injectChild(toc, { ...heading, children: [] });
+ return toc;
+}
- for (const heading of headings) {
- if (toc.length === 0) {
- toc.push({ ...heading, children: [] });
- } else {
- const lastItemInToc = toc.at(-1)!;
- if (heading.depth < lastItemInToc.depth) {
- throw new Error(`Orphan heading found: ${heading.text}.`);
- }
- if (heading.depth === lastItemInToc.depth) {
- // same depth
- toc.push({ ...heading, children: [] });
- } else {
- // higher depth
- // push into children, or children's children alike
- const gap = heading.depth - lastItemInToc.depth;
- const target = diveChildren(lastItemInToc, gap);
- target.push({ ...heading, children: [] });
- }
- }
+/** Inject a ToC entry as deep in the tree as its `depth` property requires. */
+function injectChild(items: TocItem[], item: TocItem): void {
+ const lastItem = items.at(-1);
+ if (!lastItem || lastItem.depth >= item.depth) {
+ items.push(item);
+ } else {
+ return injectChild(lastItem.children, item);
}
- return toc;
}
diff --git a/packages/starlight/components/TableOfContents/starlight-toc.ts b/packages/starlight/components/TableOfContents/starlight-toc.ts
index 1d1f4cd0231..4283f36168d 100644
--- a/packages/starlight/components/TableOfContents/starlight-toc.ts
+++ b/packages/starlight/components/TableOfContents/starlight-toc.ts
@@ -10,7 +10,7 @@ export class StarlightTOC extends HTMLElement {
this._current = link;
}
- constructor({ smallViewport = false } = {}) {
+ constructor() {
super();
/** All the links in the table of contents. */
@@ -68,19 +68,13 @@ export class StarlightTOC extends HTMLElement {
// Also observe direct children of `.content` to include elements before
// the first heading.
const toObserve = document.querySelectorAll('main [id], main [id] ~ *, main .content > *');
- /** Start intersections at nav height + 2rem padding. */
- const top = (smallViewport ? 104 : 64) + 32;
- /** End intersections 1.5rem later. */
- const bottom = top + 24;
let observer: IntersectionObserver | undefined;
- function observe() {
+ const observe = () => {
if (observer) observer.disconnect();
- const height = document.documentElement.clientHeight;
- const rootMargin = `-${top}px 0% ${bottom - height}px`;
- observer = new IntersectionObserver(setCurrent, { rootMargin });
+ observer = new IntersectionObserver(setCurrent, { rootMargin: this.getRootMargin() });
toObserve.forEach((h) => observer!.observe(h));
- }
+ };
observe();
const onIdle = window.requestIdleCallback || ((cb) => setTimeout(cb, 1));
@@ -92,6 +86,18 @@ export class StarlightTOC extends HTMLElement {
timeout = setTimeout(() => onIdle(observe), 200);
});
}
+
+ private getRootMargin(): `-${number}px 0% ${number}px` {
+ const navBarHeight = document.querySelector('header')?.getBoundingClientRect().height || 0;
+ // `` only exists in mobile ToC, so will fall back to 0 in large viewport component.
+ const mobileTocHeight = this.querySelector('summary')?.getBoundingClientRect().height || 0;
+ /** Start intersections at nav height + 2rem padding. */
+ const top = navBarHeight + mobileTocHeight + 32;
+ /** End intersections 1.5rem later. */
+ const bottom = top + 24;
+ const height = document.documentElement.clientHeight;
+ return `-${top}px 0% ${bottom - height}px`;
+ }
}
customElements.define('starlight-toc', StarlightTOC);
diff --git a/packages/starlight/index.ts b/packages/starlight/index.ts
index 2198f13fc17..50e37d046c0 100644
--- a/packages/starlight/index.ts
+++ b/packages/starlight/index.ts
@@ -68,7 +68,7 @@ export default function StarlightIntegration(opts: StarlightUserConfig): AstroIn
const cwd = dirname(fileURLToPath(import.meta.url));
const relativeDir = relative(cwd, targetDir);
return new Promise((resolve) => {
- spawn('npx', ['-y', 'pagefind', '--source', relativeDir], {
+ spawn('npx', ['-y', 'pagefind', '--site', relativeDir], {
stdio: 'inherit',
shell: true,
cwd,
diff --git a/packages/starlight/layout/Page.astro b/packages/starlight/layout/Page.astro
index 7b01c441c41..0999122dffc 100644
--- a/packages/starlight/layout/Page.astro
+++ b/packages/starlight/layout/Page.astro
@@ -45,6 +45,8 @@ const tocConfig = !hasSidebar
: config.tableOfContents;
const hasToC = Boolean(tocConfig);
const hasHero = Boolean(entry.data.hero);
+const pagefindEnabled =
+ entry.slug !== '404' && !entry.slug.endsWith('/404') && entry.data.pagefind !== false;
---
}
-
+
{/* TODO: Revisit how this logic flows. */}
{entry.data.banner && }
{
diff --git a/packages/starlight/layout/TwoColumnContent.astro b/packages/starlight/layout/TwoColumnContent.astro
index a06e91d8a9e..381632fb85e 100644
--- a/packages/starlight/layout/TwoColumnContent.astro
+++ b/packages/starlight/layout/TwoColumnContent.astro
@@ -46,7 +46,7 @@ interface Props {
width: 100%;
}
- :global([data-has-sidebar]) .main-pane {
+ :global([data-has-sidebar][data-has-toc]) .main-pane {
--sl-content-margin-inline: auto 0;
order: 1;
diff --git a/packages/starlight/package.json b/packages/starlight/package.json
index bc491d09a1f..560ac553bf4 100644
--- a/packages/starlight/package.json
+++ b/packages/starlight/package.json
@@ -1,6 +1,6 @@
{
"name": "@astrojs/starlight",
- "version": "0.9.0",
+ "version": "0.10.2",
"description": "Build beautiful, high-performance documentation websites with Astro",
"scripts": {
"test": "vitest",
@@ -45,13 +45,13 @@
"dependencies": {
"@astrojs/mdx": "^1.0.0",
"@astrojs/sitemap": "^3.0.0",
- "@pagefind/default-ui": "^1.0.0-alpha.5",
+ "@pagefind/default-ui": "^1.0.3",
"@types/mdast": "^3.0.11",
"bcp-47": "^2.1.0",
"execa": "^7.1.1",
"hast-util-select": "^5.0.5",
"hastscript": "^7.2.0",
- "pagefind": "^1.0.0-alpha.5",
+ "pagefind": "^1.0.3",
"rehype": "^12.0.1",
"remark-directive": "^2.0.1",
"unified": "^10.1.2",
diff --git a/packages/starlight/schema.ts b/packages/starlight/schema.ts
index aae1cdd4040..89fc47e2811 100644
--- a/packages/starlight/schema.ts
+++ b/packages/starlight/schema.ts
@@ -1,4 +1,5 @@
import { z } from 'astro/zod';
+import type { SchemaContext } from 'astro:content';
import { HeadConfigSchema } from './schemas/head';
import { PrevNextLinkConfigSchema } from './schemas/prevNextLink';
import { TableOfContentsSchema } from './schemas/tableOfContents';
@@ -9,25 +10,8 @@ export { i18nSchema } from './schemas/i18n';
type IconName = keyof typeof Icons;
const iconNames = Object.keys(Icons) as [IconName, ...IconName[]];
-type ImageFunction = () => z.ZodObject<{
- src: z.ZodString;
- width: z.ZodNumber;
- height: z.ZodNumber;
- format: z.ZodUnion<
- [
- z.ZodLiteral<'png'>,
- z.ZodLiteral<'jpg'>,
- z.ZodLiteral<'jpeg'>,
- z.ZodLiteral<'tiff'>,
- z.ZodLiteral<'webp'>,
- z.ZodLiteral<'gif'>,
- z.ZodLiteral<'svg'>,
- ]
- >;
-}>;
-
export function docsSchema() {
- return ({ image }: { image: ImageFunction }) =>
+ return ({ image }: SchemaContext) =>
z.object({
/** The title of the current page. Required. */
title: z.string(),
@@ -165,5 +149,8 @@ export function docsSchema() {
content: z.string(),
})
.optional(),
+
+ /** Pagefind indexing for this page - set to false to disable. */
+ pagefind: z.boolean().default(true),
});
}
diff --git a/packages/starlight/style/reset.css b/packages/starlight/style/reset.css
index 6537021914e..6a0a3c55763 100644
--- a/packages/starlight/style/reset.css
+++ b/packages/starlight/style/reset.css
@@ -38,7 +38,8 @@ h2,
h3,
h4,
h5,
-h6 {
+h6,
+code {
overflow-wrap: break-word;
}
diff --git a/packages/starlight/translations/he.json b/packages/starlight/translations/he.json
new file mode 100644
index 00000000000..e09ccec2ec6
--- /dev/null
+++ b/packages/starlight/translations/he.json
@@ -0,0 +1,22 @@
+{
+ "skipLink.label": "דלגו לתוכן",
+ "search.label": "חיפוש",
+ "search.shortcutLabel": "(לחצו / כדי לחפש)",
+ "search.cancelLabel": "ביטול",
+ "search.devWarning": "החיפוש זמין רק בסביבת ייצור. \nנסו לבנות ולהציג תצוגה מקדימה של האתר כדי לבדוק אותו באופן מקומי.",
+ "themeSelect.accessibleLabel": "בחרו פרופיל צבע",
+ "themeSelect.dark": "כהה",
+ "themeSelect.light": "בהיר",
+ "themeSelect.auto": "מערכת",
+ "languageSelect.accessibleLabel": "בחרו שפה",
+ "menuButton.accessibleLabel": "תפריט",
+ "sidebarNav.accessibleLabel": "ראשי",
+ "tableOfContents.onThisPage": "בדף זה",
+ "tableOfContents.overview": "סקירה כללית",
+ "i18n.untranslatedContent": "תוכן זה אינו זמין עדיין בשפה שלך.",
+ "page.editLink": "ערכו דף",
+ "page.lastUpdated": "עדכון אחרון:",
+ "page.previousLink": "הקודם",
+ "page.nextLink": "הבא",
+ "404.text": "הדף לא נמצא. אנא בדקו את כתובת האתר או נסו להשתמש בסרגל החיפוש."
+}
diff --git a/packages/starlight/translations/id.json b/packages/starlight/translations/id.json
new file mode 100644
index 00000000000..efc7cd0d034
--- /dev/null
+++ b/packages/starlight/translations/id.json
@@ -0,0 +1,22 @@
+{
+ "skipLink.label": "Lewati ke konten",
+ "search.label": "Pencarian",
+ "search.shortcutLabel": "(Tekan / untuk mencari)",
+ "search.cancelLabel": "Batal",
+ "search.devWarning": "Pencarian hanya tersedia pada build produksi. \nLakukan proses build dan pratinjau situs Anda sebelum mencoba di lingkungan lokal.",
+ "themeSelect.accessibleLabel": "Pilih tema",
+ "themeSelect.dark": "Gelap",
+ "themeSelect.light": "Terang",
+ "themeSelect.auto": "Otomatis",
+ "languageSelect.accessibleLabel": "Pilih Bahasa",
+ "menuButton.accessibleLabel": "Menu",
+ "sidebarNav.accessibleLabel": "Utama",
+ "tableOfContents.onThisPage": "Di halaman ini",
+ "tableOfContents.overview": "Selayang Pandang",
+ "i18n.untranslatedContent": "Konten ini belum tersedia dalam bahasa Anda.",
+ "page.editLink": "Edit halaman",
+ "page.lastUpdated": "Terakhir diperbaharui:",
+ "page.previousLink": "Sebelumnya",
+ "page.nextLink": "Selanjutnya",
+ "404.text": "Halaman tidak ditemukan. Cek kembali kolom URL atau gunakan fitur pencarian."
+}
diff --git a/packages/starlight/translations/index.ts b/packages/starlight/translations/index.ts
index 22d5188e071..1f4fdf7b5a1 100644
--- a/packages/starlight/translations/index.ts
+++ b/packages/starlight/translations/index.ts
@@ -7,6 +7,8 @@ import ja from './ja.json';
import pt from './pt.json';
import fa from './fa.json';
import fr from './fr.json';
+import he from './he.json';
+import id from './id.json';
import it from './it.json';
import nl from './nl.json';
import da from './da.json';
@@ -16,11 +18,31 @@ import nb from './nb.json';
import zh from './zh.json';
import ko from './ko.json';
import sv from './sv.json';
+import ru from './ru.json';
const { parse } = builtinI18nSchema();
export default Object.fromEntries(
- Object.entries({ cs, en, es, de, ja, pt, fa, fr, it, nl, da, tr, ar, nb, zh, ko, sv }).map(
- ([key, dict]) => [key, parse(dict)]
- )
+ Object.entries({
+ cs,
+ en,
+ es,
+ de,
+ ja,
+ pt,
+ fa,
+ fr,
+ he,
+ id,
+ it,
+ nl,
+ da,
+ tr,
+ ar,
+ nb,
+ zh,
+ ko,
+ sv,
+ ru,
+ }).map(([key, dict]) => [key, parse(dict)])
);
diff --git a/packages/starlight/translations/nl.json b/packages/starlight/translations/nl.json
index 22bb204797e..6e485fb6e0d 100644
--- a/packages/starlight/translations/nl.json
+++ b/packages/starlight/translations/nl.json
@@ -16,7 +16,7 @@
"i18n.untranslatedContent": "Deze inhoud is nog niet vertaald.",
"page.editLink": "Bewerk pagina",
"page.lastUpdated": "Laatst bewerkt:",
- "page.previousLink": "Laatste",
+ "page.previousLink": "Vorige",
"page.nextLink": "Volgende",
"404.text": "Pagina niet gevonden. Controleer de URL of probeer de zoekbalk."
}
diff --git a/packages/starlight/translations/ru.json b/packages/starlight/translations/ru.json
new file mode 100644
index 00000000000..fda513f055c
--- /dev/null
+++ b/packages/starlight/translations/ru.json
@@ -0,0 +1,22 @@
+{
+ "skipLink.label": "Пропустить до содержимого",
+ "search.label": "Поиск",
+ "search.shortcutLabel": "(Нажмите / для Поиска)",
+ "search.cancelLabel": "Отменить",
+ "search.devWarning": "Поиск доступен только в производственных сборках. \nПопробуйте выполнить сборку и просмотреть сайт, чтобы протестировать его локально.",
+ "themeSelect.accessibleLabel": "Выберите тему",
+ "themeSelect.dark": "Темная",
+ "themeSelect.light": "Светлая",
+ "themeSelect.auto": "Авто",
+ "languageSelect.accessibleLabel": "Выберите язык",
+ "menuButton.accessibleLabel": "Меню",
+ "sidebarNav.accessibleLabel": "Основное",
+ "tableOfContents.onThisPage": "На странице",
+ "tableOfContents.overview": "Обзор",
+ "i18n.untranslatedContent": "Этот содержимое пока не доступно на вашем языке.",
+ "page.editLink": "Редактировать странице",
+ "page.lastUpdated": "Последнее обновление:",
+ "page.previousLink": "Предыдущая",
+ "page.nextLink": "Следующая",
+ "404.text": "Страница не найдена. Проверьтье URL или используйте поиск по сайту"
+}
diff --git a/packages/starlight/utils/routing.ts b/packages/starlight/utils/routing.ts
index 56bd7c84ab0..496578ce204 100644
--- a/packages/starlight/utils/routing.ts
+++ b/packages/starlight/utils/routing.ts
@@ -35,10 +35,12 @@ interface Path extends GetStaticPathsItem {
const normalizeIndexSlug = (slug: string) => (slug === 'index' ? '' : slug);
/** All entries in the docs content collection. */
-const docs: StarlightDocsEntry[] = (await getCollection('docs')).map(({ slug, ...entry }) => ({
- ...entry,
- slug: normalizeIndexSlug(slug),
-}));
+const docs: StarlightDocsEntry[] = ((await getCollection('docs')) ?? []).map(
+ ({ slug, ...entry }) => ({
+ ...entry,
+ slug: normalizeIndexSlug(slug),
+ })
+);
function getRoutes(): Route[] {
const routes: Route[] = docs.map((entry) => ({
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f5f47b5741d..61708d8f88c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -103,7 +103,7 @@ importers:
examples/basics:
dependencies:
'@astrojs/starlight':
- specifier: ^0.9.0
+ specifier: ^0.10.2
version: link:../../packages/starlight
astro:
specifier: ^3.0.6
@@ -115,7 +115,7 @@ importers:
examples/tailwind:
dependencies:
'@astrojs/starlight':
- specifier: ^0.9.0
+ specifier: ^0.10.2
version: link:../../packages/starlight
'@astrojs/starlight-tailwind':
specifier: ^2.0.0
@@ -142,8 +142,8 @@ importers:
specifier: ^3.0.0
version: 3.0.0
'@pagefind/default-ui':
- specifier: ^1.0.0-alpha.5
- version: 1.0.0-alpha.5
+ specifier: ^1.0.3
+ version: 1.0.3
'@types/mdast':
specifier: ^3.0.11
version: 3.0.11
@@ -160,8 +160,8 @@ importers:
specifier: ^7.2.0
version: 7.2.0
pagefind:
- specifier: ^1.0.0-alpha.5
- version: 1.0.0-alpha.5
+ specifier: ^1.0.3
+ version: 1.0.3
rehype:
specifier: ^12.0.1
version: 12.0.1
@@ -1256,44 +1256,44 @@ packages:
'@nodelib/fs.scandir': 2.1.5
fastq: 1.15.0
- /@pagefind/darwin-arm64@1.0.0-alpha.5:
- resolution: {integrity: sha512-peZTl2+ndCupYkJ2qg16UDMKijosAU4BBFhpDv1ckjW49BE0Lh4vXHY12DxTvKaHrEu2XvC5blSjC+fkMe64vg==}
+ /@pagefind/darwin-arm64@1.0.3:
+ resolution: {integrity: sha512-vsHDtvao3W4iFCxVc4S0BVhpj3E2MAoIVM7RmuQfGp1Ng22nGLRaMP6FguLO8TMabRJdvp4SVr227hL4WGKOHA==}
cpu: [arm64]
os: [darwin]
requiresBuild: true
dev: false
optional: true
- /@pagefind/darwin-x64@1.0.0-alpha.5:
- resolution: {integrity: sha512-3M35um77sLndK+nBS0eyYf9FvdzwFQ0BPhVu5Gs6pP7vPAtayzBkwtLsdrbRBeHpCODwF8Eg4zvxTQBc2+nhAg==}
+ /@pagefind/darwin-x64@1.0.3:
+ resolution: {integrity: sha512-NhEXHHYmB/hT6lx5rCcmnVTxH+uIkMAd43bzEqMwHQosqTZEIQfwihmV39H+m8yo7jFvz3zRbJNzhAh7G4PiwA==}
cpu: [x64]
os: [darwin]
requiresBuild: true
dev: false
optional: true
- /@pagefind/default-ui@1.0.0-alpha.5:
- resolution: {integrity: sha512-swifkGRaPijH7mwMfQ7eNUxPh9Uvxzhi2sgmA9ipcc3Kcptu/O8em0jdCOwynyBIb5gJC6Paq3Hr+i2hJ5o1Hw==}
+ /@pagefind/default-ui@1.0.3:
+ resolution: {integrity: sha512-WieFJXvezyvjZh49I8j7a7Kz3LsXYY2Uep3IWvG5NG05mmiurURXjXc+KyrpIp/iAycSnjrC1TDJ8CdES/ee3A==}
dev: false
- /@pagefind/linux-arm64@1.0.0-alpha.5:
- resolution: {integrity: sha512-LkOCsyhw15X87eJLHiHPcZmhM7QON4Au/68j0e7y6zCnXhzqjvs/26GqSfUdXhVIdGydxiKiPbSp9scbu15mKQ==}
+ /@pagefind/linux-arm64@1.0.3:
+ resolution: {integrity: sha512-RGsMt4AmGT8WxCSeP09arU7Za6Vf/We4TWHVSbY7vDMuwWql9Ngoib/q1cP9dIAIMdkXh9ePG/S3mGnJYsdzuQ==}
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: false
optional: true
- /@pagefind/linux-x64@1.0.0-alpha.5:
- resolution: {integrity: sha512-k4k5hDX1zVejCby+f58/Ymx2ftQ/Misb31T0Zje0aO7n41GeWAimfZVetHOpHmBsyXBXm+afHwXdpWHL5vUkuA==}
+ /@pagefind/linux-x64@1.0.3:
+ resolution: {integrity: sha512-o+VCKaqImL42scSH1n5gUfppYSNyu3BuGTvtKKgWHmycbL+A3fkFH+ZOFbaLeN7LVTvJqJIOYbk4j2yaq9784Q==}
cpu: [x64]
os: [linux]
requiresBuild: true
dev: false
optional: true
- /@pagefind/windows-x64@1.0.0-alpha.5:
- resolution: {integrity: sha512-lXvE/4hsfF0tRkvPV+RkmAdysFcqlfGCTh/326E5NMtaQr9zILf9skuX3/1GwkmeojBAZssIQm2w+MdtULIzMA==}
+ /@pagefind/windows-x64@1.0.3:
+ resolution: {integrity: sha512-S+Yq4FyvXJm4F+iN/wRiLvEEF8Xs9lTKGtQGaRHXJslQyl65dytDDPIULXJXIadrDbnMrnTt4C2YHmEUIyUIHg==}
cpu: [x64]
os: [win32]
requiresBuild: true
@@ -4926,15 +4926,15 @@ packages:
- utf-8-validate
dev: true
- /pagefind@1.0.0-alpha.5:
- resolution: {integrity: sha512-uf0AMnxoAwiyn5a8mfaCk7skeXCRoZEh6E8JeX4NX3aUOoVyQNA2hJ2VGGbtM85mYT2AdiaG89zh7EqzakeDIw==}
+ /pagefind@1.0.3:
+ resolution: {integrity: sha512-ws7kmMxW6OuxzsOjj3YAx6TYq/54MiE3wfyBM3J5CInbZyBBvM2Z8c8IYvnMkBcb5v2EoB9DewXEekOEiDRu5g==}
hasBin: true
optionalDependencies:
- '@pagefind/darwin-arm64': 1.0.0-alpha.5
- '@pagefind/darwin-x64': 1.0.0-alpha.5
- '@pagefind/linux-arm64': 1.0.0-alpha.5
- '@pagefind/linux-x64': 1.0.0-alpha.5
- '@pagefind/windows-x64': 1.0.0-alpha.5
+ '@pagefind/darwin-arm64': 1.0.3
+ '@pagefind/darwin-x64': 1.0.3
+ '@pagefind/linux-arm64': 1.0.3
+ '@pagefind/linux-x64': 1.0.3
+ '@pagefind/windows-x64': 1.0.3
dev: false
/parse-entities@4.0.1: