diff --git a/.changeset/heavy-rocks-sparkle.md b/.changeset/heavy-rocks-sparkle.md new file mode 100644 index 00000000000..5c23182a7e7 --- /dev/null +++ b/.changeset/heavy-rocks-sparkle.md @@ -0,0 +1,5 @@ +--- +"@astrojs/starlight": patch +--- + +Adds Italian translation for `search.devWarning` UI diff --git a/.changeset/plenty-carrots-rescue.md b/.changeset/plenty-carrots-rescue.md new file mode 100644 index 00000000000..e256fc05ea4 --- /dev/null +++ b/.changeset/plenty-carrots-rescue.md @@ -0,0 +1,5 @@ +--- +'@astrojs/starlight': patch +--- + +Refactor `getLastUpdated` to use `node:child_process` instead of `execa`. diff --git a/docs/src/content/docs/da/guides/project-structure.mdx b/docs/src/content/docs/da/guides/project-structure.mdx index b05f2e1e01e..11d203ca76a 100644 --- a/docs/src/content/docs/da/guides/project-structure.mdx +++ b/docs/src/content/docs/da/guides/project-structure.mdx @@ -20,7 +20,7 @@ Starlight projekter følger for det meste den samme fil- og mappestruktur som an En Starlight projektstruktur kunne se sådan ud: -import FileTree from '../../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/da/index.mdx b/docs/src/content/docs/da/index.mdx index f53db6ed272..f2d60ac4ae8 100644 --- a/docs/src/content/docs/da/index.mdx +++ b/docs/src/content/docs/da/index.mdx @@ -8,7 +8,7 @@ hero: title: Få din dokumentation til at skinne med Starlight tagline: Alt du har brug for, for at bygge en skindende dokumentationsside. Hurtig, tilgængelig og nem at bruge. image: - file: ../../../assets/hero-star.webp + file: ~/assets/hero-star.webp actions: - text: Kom igang icon: right-arrow @@ -20,7 +20,7 @@ hero: --- import { CardGrid, Card } from '@astrojs/starlight/components'; -import AboutAstro from '../../../components/about-astro.astro'; +import AboutAstro from '~/components/about-astro.astro'; diff --git a/docs/src/content/docs/da/showcase.mdx b/docs/src/content/docs/da/showcase.mdx index 486619bd648..b859c5b2902 100644 --- a/docs/src/content/docs/da/showcase.mdx +++ b/docs/src/content/docs/da/showcase.mdx @@ -10,7 +10,7 @@ Har du bygget en hjemmeside med Starlight eller et værktøj til Starlight? ## Sites -import ShowcaseSites from '../../../components/showcase-sites.astro'; +import ShowcaseSites from '~/components/showcase-sites.astro'; Starlight bliver allerede brugt i produktion. Disse er nogle af de sider fra rund omkring på internettet: diff --git a/docs/src/content/docs/de/guides/components.mdx b/docs/src/content/docs/de/guides/components.mdx index 10c34cd3a8b..8db24999e8a 100644 --- a/docs/src/content/docs/de/guides/components.mdx +++ b/docs/src/content/docs/de/guides/components.mdx @@ -20,8 +20,8 @@ Diese sehen wie HTML-Tags aus, beginnen aber mit einem Großbuchstaben, der dem title: Willkommen bei meiner Dokumentation --- -import SomeComponent from '../../../components/SomeComponent.astro'; -import AnotherComponent from '../../../components/AnotherComponent.astro'; +import SomeComponent from '~/components/SomeComponent.astro'; +import AnotherComponent from '~/components/AnotherComponent.astro'; @@ -176,7 +176,7 @@ import { LinkCard } from '@astrojs/starlight/components'; ### Icon import { Icon } from '@astrojs/starlight/components'; -import IconsList from '../../../../components/icons-list.astro'; +import IconsList from '~/components/icons-list.astro'; Starlight stellt eine Reihe von allgemeinen Icons zur Verfügung, die du mit der Komponente `` in deinem Inhalt anzeigen kannst. diff --git a/docs/src/content/docs/de/guides/css-and-tailwind.mdx b/docs/src/content/docs/de/guides/css-and-tailwind.mdx index 051a0190524..6c8ece60886 100644 --- a/docs/src/content/docs/de/guides/css-and-tailwind.mdx +++ b/docs/src/content/docs/de/guides/css-and-tailwind.mdx @@ -245,7 +245,7 @@ Die dunklen und hellen Vorschaubereiche zeigen die resultierenden Farben, und di Wenn du mit deinen Änderungen zufrieden bist, kopiere den CSS- oder Tailwind-Code unten und verwende ihn in deinem Projekt. -import ThemeDesigner from '../../../../components/theme-designer.astro'; +import ThemeDesigner from '~/components/theme-designer.astro'; diff --git a/docs/src/content/docs/de/guides/sidebar.mdx b/docs/src/content/docs/de/guides/sidebar.mdx index 8b32c37c9a8..24c0fc38aca 100644 --- a/docs/src/content/docs/de/guides/sidebar.mdx +++ b/docs/src/content/docs/de/guides/sidebar.mdx @@ -3,8 +3,8 @@ title: Seitenleisten-Navigation description: Erfahre, wie du die Navigationslinks in der Seitenleiste deiner Starlight-Website einrichten und anpassen kannst. --- -import FileTree from '../../../../components/file-tree.astro'; -import SidebarPreview from '../../../../components/sidebar-preview.astro'; +import FileTree from '~/components/file-tree.astro'; +import SidebarPreview from '~/components/sidebar-preview.astro'; Eine gut organisierte Seitenleiste ist der Schlüssel zu einer guten Dokumentation, da sie eine der Hauptwege ist, auf denen die Benutzer durch deine Website navigieren werden. Starlight bietet eine ganze Reihe von Optionen, um das Layout und den Inhalt der Seitenleiste anzupassen. diff --git a/docs/src/content/docs/de/index.mdx b/docs/src/content/docs/de/index.mdx index fd28e650b31..f5ef3b197d6 100644 --- a/docs/src/content/docs/de/index.mdx +++ b/docs/src/content/docs/de/index.mdx @@ -6,7 +6,7 @@ hero: title: Bringe deine Dokumentation mit Starlight zum Leuchten tagline: Alles, was du brauchst, um eine erstklassige Dokumentations-Website zu erstellen. Schnell, barrierefrei und einfach zu bedienen. image: - file: ../../../assets/hero-star.webp + file: ~/assets/hero-star.webp actions: - text: Los geht's icon: right-arrow @@ -18,7 +18,7 @@ hero: --- import { CardGrid, Card } from '@astrojs/starlight/components'; -import AboutAstro from '../../../components/about-astro.astro'; +import AboutAstro from '~/components/about-astro.astro'; diff --git a/docs/src/content/docs/de/manual-setup.mdx b/docs/src/content/docs/de/manual-setup.mdx index f13b21c8541..8d5203308c1 100644 --- a/docs/src/content/docs/de/manual-setup.mdx +++ b/docs/src/content/docs/de/manual-setup.mdx @@ -106,7 +106,7 @@ Um alle Starlight-Seiten mit einem anderen Pfad aufrufen zu können, lege den ge Wenn zum Beispiel die URL alle Starlight-Seiten mit `/guides/` beginnen sollen, füge deine Inhalte in das Verzeichnis `src/content/docs/guides/` ein: -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/de/reference/configuration.mdx b/docs/src/content/docs/de/reference/configuration.mdx index abc6711b866..a937320afcf 100644 --- a/docs/src/content/docs/de/reference/configuration.mdx +++ b/docs/src/content/docs/de/reference/configuration.mdx @@ -306,7 +306,7 @@ Das `defaultLocale` wird verwendet, um Ersatzinhalte bereitzustellen, wenn Über ### `social` -import SocialLinksType from '../../../../components/social-links-type.astro'; +import SocialLinksType from '~/components/social-links-type.astro'; **Typ:** diff --git a/docs/src/content/docs/de/showcase.mdx b/docs/src/content/docs/de/showcase.mdx index cc52c282659..d4b1386c61f 100644 --- a/docs/src/content/docs/de/showcase.mdx +++ b/docs/src/content/docs/de/showcase.mdx @@ -10,7 +10,7 @@ Eröffne einen PR und füge einen Link zu dieser Seite hinzu! ## Seiten -import ShowcaseSites from '../../../components/showcase-sites.astro'; +import ShowcaseSites from '~/components/showcase-sites.astro'; Starlight wird bereits in der Produktion eingesetzt. Dies sind einige der Websiten, die im Internet zu finden sind: diff --git a/docs/src/content/docs/es/getting-started.mdx b/docs/src/content/docs/es/getting-started.mdx index ceb8c94fee6..116c8b45b50 100644 --- a/docs/src/content/docs/es/getting-started.mdx +++ b/docs/src/content/docs/es/getting-started.mdx @@ -94,7 +94,7 @@ Utiliza subcarpetas para organizar tus archivos y crear múltiples segmentos de Por ejemplo, la siguiente estructura de archivos generará páginas en `example.com/hello-world` y `example.com/guides/faq`: -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/es/guides/components.mdx b/docs/src/content/docs/es/guides/components.mdx index 3dbb746e3f0..ca35f3e2560 100644 --- a/docs/src/content/docs/es/guides/components.mdx +++ b/docs/src/content/docs/es/guides/components.mdx @@ -193,7 +193,7 @@ import { LinkCard } from '@astrojs/starlight/components'; ### Iconos import { Icon } from '@astrojs/starlight/components'; -import IconsList from '../../../../components/icons-list.astro'; +import IconsList from '~/components/icons-list.astro'; Starlight proporciona un conjunto de iconos comunes que puedes mostrar en tu contenido utilizando el componente ``. diff --git a/docs/src/content/docs/es/guides/css-and-tailwind.mdx b/docs/src/content/docs/es/guides/css-and-tailwind.mdx index 2d5e0b382b8..0fa84457eb8 100644 --- a/docs/src/content/docs/es/guides/css-and-tailwind.mdx +++ b/docs/src/content/docs/es/guides/css-and-tailwind.mdx @@ -245,7 +245,7 @@ Las áreas de vista previa oscura y clara mostrarán los colores resultantes, y Cuando estés satisfecho con tus cambios, copia el código CSS o Tailwind a continuación y úsalo en tu proyecto. -import ThemeDesigner from '../../../../components/theme-designer.astro'; +import ThemeDesigner from '~/components/theme-designer.astro'; diff --git a/docs/src/content/docs/es/guides/sidebar.mdx b/docs/src/content/docs/es/guides/sidebar.mdx index be5bdd61af0..38520e8bb5b 100644 --- a/docs/src/content/docs/es/guides/sidebar.mdx +++ b/docs/src/content/docs/es/guides/sidebar.mdx @@ -3,8 +3,8 @@ 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. --- -import FileTree from '../../../../components/file-tree.astro'; -import SidebarPreview from '../../../../components/sidebar-preview.astro'; +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. diff --git a/docs/src/content/docs/es/index.mdx b/docs/src/content/docs/es/index.mdx index ebf4913faef..45768a32c16 100644 --- a/docs/src/content/docs/es/index.mdx +++ b/docs/src/content/docs/es/index.mdx @@ -11,7 +11,7 @@ hero: title: Haz que tus docs brillen con Starlight tagline: Todo lo que necesitas para construir un sitio web de documentación estelar. Rápido, accesible y fácil de usar. image: - file: ../../../assets/hero-star.webp + file: ~/assets/hero-star.webp actions: - text: Empezar icon: right-arrow @@ -23,7 +23,7 @@ hero: --- import { CardGrid, Card } from '@astrojs/starlight/components'; -import AboutAstro from '../../../components/about-astro.astro'; +import AboutAstro from '~/components/about-astro.astro'; diff --git a/docs/src/content/docs/es/manual-setup.mdx b/docs/src/content/docs/es/manual-setup.mdx index b679ce2a859..a7304aafa92 100644 --- a/docs/src/content/docs/es/manual-setup.mdx +++ b/docs/src/content/docs/es/manual-setup.mdx @@ -106,7 +106,7 @@ Para agregar todas las páginas de Starlight en una subruta, coloca todo tu cont Por ejemplo, si las páginas de Starlight deben comenzar con `/guides/`, agrega tu contenido en el directorio `src/content/docs/guides/`: -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/es/reference/configuration.mdx b/docs/src/content/docs/es/reference/configuration.mdx index 08a27d8a49d..65558c92334 100644 --- a/docs/src/content/docs/es/reference/configuration.mdx +++ b/docs/src/content/docs/es/reference/configuration.mdx @@ -308,7 +308,7 @@ El idioma predeterminado se utilizará para proporcionar contenido de respaldo d ### `social` -import SocialLinksType from '../../../../components/social-links-type.astro'; +import SocialLinksType from '~/components/social-links-type.astro'; **tipo:** diff --git a/docs/src/content/docs/es/showcase.mdx b/docs/src/content/docs/es/showcase.mdx index 5c6f217a583..01427a2305d 100644 --- a/docs/src/content/docs/es/showcase.mdx +++ b/docs/src/content/docs/es/showcase.mdx @@ -10,7 +10,7 @@ description: ¡Descubre los sitios construidos con Starlight y herramientas comu ## Sitios -import ShowcaseSites from '../../../components/showcase-sites.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: diff --git a/docs/src/content/docs/fr/getting-started.mdx b/docs/src/content/docs/fr/getting-started.mdx index a6df071a8c5..6db6b5778ef 100644 --- a/docs/src/content/docs/fr/getting-started.mdx +++ b/docs/src/content/docs/fr/getting-started.mdx @@ -95,7 +95,7 @@ Utilisez des sous-dossiers pour organiser vos fichiers et créer plusieurs segme Par exemple, la structure de fichiers suivante génére des pages à `example.com/hello-world` et `example.com/guides/faq` : -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/fr/guides/components.mdx b/docs/src/content/docs/fr/guides/components.mdx index c2d6ba94617..b3d31c0c6de 100644 --- a/docs/src/content/docs/fr/guides/components.mdx +++ b/docs/src/content/docs/fr/guides/components.mdx @@ -182,7 +182,7 @@ import { LinkCard } from '@astrojs/starlight/components'; ### Icônes import { Icon } from '@astrojs/starlight/components'; -import IconsList from '../../../../components/icons-list.astro'; +import IconsList from '~/components/icons-list.astro'; Starlight fournit un ensemble d'icônes courantes que vous pouvez afficher dans votre contenu à l'aide du composant ``. diff --git a/docs/src/content/docs/fr/guides/css-and-tailwind.mdx b/docs/src/content/docs/fr/guides/css-and-tailwind.mdx index 6fc57aa0040..6618923945a 100644 --- a/docs/src/content/docs/fr/guides/css-and-tailwind.mdx +++ b/docs/src/content/docs/fr/guides/css-and-tailwind.mdx @@ -249,7 +249,7 @@ Les zones d'aperçu sombre et clair afficheront les couleurs résultantes, et la Quand vous êtes satisfait de vos modifications, copiez le code CSS ou Tailwind ci-dessous et utilisez-le dans votre projet. -import ThemeDesigner from '../../../../components/theme-designer.astro'; +import ThemeDesigner from '~/components/theme-designer.astro'; diff --git a/docs/src/content/docs/fr/guides/sidebar.mdx b/docs/src/content/docs/fr/guides/sidebar.mdx index 4c6210f89f6..d595600b648 100644 --- a/docs/src/content/docs/fr/guides/sidebar.mdx +++ b/docs/src/content/docs/fr/guides/sidebar.mdx @@ -3,8 +3,8 @@ title: Barre latérale de navigation description: Apprendre à configurer et personnaliser les liens de la barre latérale de navigation de votre site Starlight. --- -import FileTree from '../../../../components/file-tree.astro'; -import SidebarPreview from '../../../../components/sidebar-preview.astro'; +import FileTree from '~/components/file-tree.astro'; +import SidebarPreview from '~/components/sidebar-preview.astro'; Une barre latérale bien organisée est une des clés d'une bonne documentation, car c'est l'une des principales méthodes de navigation qui sera utilisée par les utilisateurs de votre site. Starlight fournit un ensemble complet d'options pour personnaliser la structure et le contenu de votre barre latérale. diff --git a/docs/src/content/docs/fr/index.mdx b/docs/src/content/docs/fr/index.mdx index 0de614ca9e0..6c10995768a 100644 --- a/docs/src/content/docs/fr/index.mdx +++ b/docs/src/content/docs/fr/index.mdx @@ -11,7 +11,7 @@ hero: title: Faites briller vos documents avec Starlight tagline: Tout ce dont vous avez besoin pour créer un excellent site web de documentation. Rapide, accessible et facile à utiliser. image: - file: ../../../assets/hero-star.webp + file: ~/assets/hero-star.webp actions: - text: Mise en route icon: right-arrow @@ -23,7 +23,7 @@ hero: --- import { CardGrid, Card } from '@astrojs/starlight/components'; -import AboutAstro from '../../../components/about-astro.astro'; +import AboutAstro from '~/components/about-astro.astro'; diff --git a/docs/src/content/docs/fr/manual-setup.mdx b/docs/src/content/docs/fr/manual-setup.mdx index 12008ed2eb2..f0c7b2c4437 100644 --- a/docs/src/content/docs/fr/manual-setup.mdx +++ b/docs/src/content/docs/fr/manual-setup.mdx @@ -106,7 +106,7 @@ Pour ajouter toutes les pages Starlight dans un sous-chemin, placez tout votre c Par exemple, si les pages de Starlight doivent toutes commencer par `/guides/`, ajoutez votre contenu dans le répertoire `src/content/docs/guides/` : -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/fr/reference/configuration.mdx b/docs/src/content/docs/fr/reference/configuration.mdx index 967ba48b295..96ce47fe8bc 100644 --- a/docs/src/content/docs/fr/reference/configuration.mdx +++ b/docs/src/content/docs/fr/reference/configuration.mdx @@ -307,7 +307,7 @@ La locale par défaut sera utilisée pour fournir un contenu de remplacement lor ### `social` -import SocialLinksType from '../../../../components/social-links-type.astro'; +import SocialLinksType from '~/components/social-links-type.astro'; **Type :** diff --git a/docs/src/content/docs/fr/showcase.mdx b/docs/src/content/docs/fr/showcase.mdx index edc201ac75c..4843f3be14c 100644 --- a/docs/src/content/docs/fr/showcase.mdx +++ b/docs/src/content/docs/fr/showcase.mdx @@ -10,7 +10,7 @@ Ouvrez une PR en ajoutant un lien à cette page ! ## Sites -import ShowcaseSites from '../../../components/showcase-sites.astro'; +import ShowcaseSites from '~/components/showcase-sites.astro'; Starlight est déjà utilisé en production. Voici quelques sites sur le web : diff --git a/docs/src/content/docs/getting-started.mdx b/docs/src/content/docs/getting-started.mdx index 1157eb97a87..d65806145a9 100644 --- a/docs/src/content/docs/getting-started.mdx +++ b/docs/src/content/docs/getting-started.mdx @@ -95,7 +95,7 @@ Use sub-folders to organize your files and to create multiple path segments. For example, the following file structure will generate pages at `example.com/hello-world` and `example.com/guides/faq`: -import FileTree from '../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/guides/components.mdx b/docs/src/content/docs/guides/components.mdx index e89fce3a180..34658f327d3 100644 --- a/docs/src/content/docs/guides/components.mdx +++ b/docs/src/content/docs/guides/components.mdx @@ -172,7 +172,7 @@ import { LinkCard } from '@astrojs/starlight/components'; ### Icon import { Icon } from '@astrojs/starlight/components'; -import IconsList from '../../../components/icons-list.astro'; +import IconsList from '~/components/icons-list.astro'; Starlight provides a set of common icons that you can display in your content using the `` component. diff --git a/docs/src/content/docs/guides/css-and-tailwind.mdx b/docs/src/content/docs/guides/css-and-tailwind.mdx index e2c7b513ce3..58e611152f9 100644 --- a/docs/src/content/docs/guides/css-and-tailwind.mdx +++ b/docs/src/content/docs/guides/css-and-tailwind.mdx @@ -245,7 +245,7 @@ The dark and light preview areas will show the resulting colors, and the whole p When you’re happy with your changes, copy the CSS or Tailwind code below and use it in your project. -import ThemeDesigner from '../../../components/theme-designer.astro'; +import ThemeDesigner from '~/components/theme-designer.astro'; diff --git a/docs/src/content/docs/guides/sidebar.mdx b/docs/src/content/docs/guides/sidebar.mdx index e2b4271ddcc..83c216623ed 100644 --- a/docs/src/content/docs/guides/sidebar.mdx +++ b/docs/src/content/docs/guides/sidebar.mdx @@ -3,8 +3,8 @@ title: Sidebar Navigation description: Learn how to set up and customize your Starlight site’s sidebar navigation links. --- -import FileTree from '../../../components/file-tree.astro'; -import SidebarPreview from '../../../components/sidebar-preview.astro'; +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. diff --git a/docs/src/content/docs/hi/getting-started.mdx b/docs/src/content/docs/hi/getting-started.mdx index 50d62fed43d..3905b230bd0 100644 --- a/docs/src/content/docs/hi/getting-started.mdx +++ b/docs/src/content/docs/hi/getting-started.mdx @@ -95,7 +95,7 @@ Starlight बिना किसी कॉन्फ़िगरेशन की उदाहरण के लिए, निम्नलिखित फ़ाइल संरचना `example.com/hello-world` और `example.com/guides/faq` पर पेज बनाएगी: -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/hi/guides/css-and-tailwind.mdx b/docs/src/content/docs/hi/guides/css-and-tailwind.mdx index b1f9f8cf40d..027b32c894c 100644 --- a/docs/src/content/docs/hi/guides/css-and-tailwind.mdx +++ b/docs/src/content/docs/hi/guides/css-and-tailwind.mdx @@ -245,7 +245,7 @@ Starlight के उच्चारण और ग्रे रंग पैल जब आप अपने परिवर्तनों से खुश हों, तो नीचे दिए गए CSS या Tailwind कोड को कॉपी करें और इसे अपने परियोजना में उपयोग करें। -import ThemeDesigner from '../../../../components/theme-designer.astro'; +import ThemeDesigner from '~/components/theme-designer.astro'; diff --git a/docs/src/content/docs/hi/index.mdx b/docs/src/content/docs/hi/index.mdx index 7f4a754221e..16a81e3a99a 100644 --- a/docs/src/content/docs/hi/index.mdx +++ b/docs/src/content/docs/hi/index.mdx @@ -11,7 +11,7 @@ hero: title: अपने दस्तावेज़ों को Starlight से चमकाएँ tagline: एक तारकीय दस्तावेज़ीकरण वेबसाइट बनाने के लिए आपको जो कुछ भी चाहिए वह सब कुछ इधर हैं। तेज़, अभिगम्य और उपयोग में आसान। image: - file: ../../../assets/hero-star.webp + file: ~/assets/hero-star.webp actions: - text: शुरू हो जाओ icon: right-arrow @@ -23,7 +23,7 @@ hero: --- import { CardGrid, Card } from '@astrojs/starlight/components'; -import AboutAstro from '../../../components/about-astro.astro'; +import AboutAstro from '~/components/about-astro.astro'; diff --git a/docs/src/content/docs/hi/manual-setup.mdx b/docs/src/content/docs/hi/manual-setup.mdx index 28722afa8da..657ce85f606 100644 --- a/docs/src/content/docs/hi/manual-setup.mdx +++ b/docs/src/content/docs/hi/manual-setup.mdx @@ -106,7 +106,7 @@ Starlight फ़ाइल-आधारित रूटिंग का उपय उदाहरण के लिए, यदि Starlight पेज सभी `/guides/` से शुरू होने चाहिए, तो अपनी सामग्री को `src/content/docs/guides/` निर्देशिका में जोड़ें: -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/hi/showcase.mdx b/docs/src/content/docs/hi/showcase.mdx index 397a7b1a7cc..c9fcc3d25d5 100644 --- a/docs/src/content/docs/hi/showcase.mdx +++ b/docs/src/content/docs/hi/showcase.mdx @@ -10,7 +10,7 @@ description: Starlight और सामुदायिक टूल से न ## साइटें -import ShowcaseSites from '../../../components/showcase-sites.astro'; +import ShowcaseSites from '~/components/showcase-sites.astro'; Starlight का उपयोग पहले से ही उत्पादन में किया जा रहा है। ये वेब पर मौजूद कुछ साइटें हैं: diff --git a/docs/src/content/docs/id/getting-started.mdx b/docs/src/content/docs/id/getting-started.mdx index 862d4d8aac8..fdf2284f9c5 100644 --- a/docs/src/content/docs/id/getting-started.mdx +++ b/docs/src/content/docs/id/getting-started.mdx @@ -95,7 +95,7 @@ Gunakan sub-folder untuk mengatur konten Anda dan untuk membuat beberapa segmen Sebagai contoh, struktur file berikut ini akan menghasilkan halaman di `example.com/hello-world` dan `example.com/guides/faq`: -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/id/guides/components.mdx b/docs/src/content/docs/id/guides/components.mdx index 9ff878877b0..5efaa87d47e 100644 --- a/docs/src/content/docs/id/guides/components.mdx +++ b/docs/src/content/docs/id/guides/components.mdx @@ -166,7 +166,7 @@ import { LinkCard } from '@astrojs/starlight/components'; ### Icon import { Icon } from '@astrojs/starlight/components'; -import IconsList from '../../../../components/icons-list.astro'; +import IconsList from '~/components/icons-list.astro'; Starlight menyediakan sejumlah icon umum yang dapat Anda tampilkan dalam konten Anda menggunakan komponen ``. diff --git a/docs/src/content/docs/id/guides/css-and-tailwind.mdx b/docs/src/content/docs/id/guides/css-and-tailwind.mdx index affee7c51ca..1bcd1e4e33d 100644 --- a/docs/src/content/docs/id/guides/css-and-tailwind.mdx +++ b/docs/src/content/docs/id/guides/css-and-tailwind.mdx @@ -245,7 +245,7 @@ Preview gelap dan terang akan menampilkan warna-warna hasilnya, dan seluruh hala Saat Anda puas dengan perubahan Anda, salin CSS atau kode Tailwind di bawah ini dan gunakan di proyek Anda. -import ThemeDesigner from '../../../../components/theme-designer.astro'; +import ThemeDesigner from '~/components/theme-designer.astro'; diff --git a/docs/src/content/docs/id/guides/sidebar.mdx b/docs/src/content/docs/id/guides/sidebar.mdx index 8f8c2251baf..8c48ca03d4a 100644 --- a/docs/src/content/docs/id/guides/sidebar.mdx +++ b/docs/src/content/docs/id/guides/sidebar.mdx @@ -3,8 +3,8 @@ title: Navigasi Sidebar description: Pelajari cara mengatur dan menyesuaikan tautan navigasi sidebar website Starlight Anda. --- -import FileTree from '../../../../components/file-tree.astro'; -import SidebarPreview from '../../../../components/sidebar-preview.astro'; +import FileTree from '~/components/file-tree.astro'; +import SidebarPreview from '~/components/sidebar-preview.astro'; Sidebar yang terorganisir dengan baik adalah kunci untuk dokumentasi yang baik karena ini adalah salah satu cara utama pengguna akan menjelajahi website Anda. Starlight menyediakan rangkaian opsi lengkap untuk menyesuaikan tata letak dan konten sidebar Anda. diff --git a/docs/src/content/docs/id/index.mdx b/docs/src/content/docs/id/index.mdx index ccb4642603c..c4dd56dfc18 100644 --- a/docs/src/content/docs/id/index.mdx +++ b/docs/src/content/docs/id/index.mdx @@ -6,7 +6,7 @@ hero: title: Buat dokumentasi yang bersinar dengan Starlight tagline: Semua yang Anda butuhkan untuk membangun website dokumentasi yang luar biasa. Cepat, ramah pengguna, dan sangat mudah digunakan. image: - file: ../../../assets/hero-star.webp + file: ~/assets/hero-star.webp actions: - text: Memulai icon: right-arrow @@ -18,7 +18,7 @@ hero: --- import { CardGrid, Card } from '@astrojs/starlight/components'; -import AboutAstro from '../../../components/about-astro.astro'; +import AboutAstro from '~/components/about-astro.astro'; diff --git a/docs/src/content/docs/id/manual-setup.mdx b/docs/src/content/docs/id/manual-setup.mdx index 3b11f3e8d5b..5adc9fe47e5 100644 --- a/docs/src/content/docs/id/manual-setup.mdx +++ b/docs/src/content/docs/id/manual-setup.mdx @@ -106,7 +106,7 @@ Untuk menambahkan halaman Starlight di dalam _subpath_, letakkan konten dokument Contohnya, jika halaman Starlight berada pada rute `/panduan/`, letakkan konten dokumentasi Anda di folder `src/content/docs/panduan/`: -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/id/reference/configuration.mdx b/docs/src/content/docs/id/reference/configuration.mdx index a7d0cc3107d..3ab8a6ab0ac 100644 --- a/docs/src/content/docs/id/reference/configuration.mdx +++ b/docs/src/content/docs/id/reference/configuration.mdx @@ -308,7 +308,7 @@ Bahasa default akan digunakan untuk memberikan konten cadangan ketika terjemahan ### `social` -import SocialLinksType from '../../../../components/social-links-type.astro'; +import SocialLinksType from '~/components/social-links-type.astro'; **type:** diff --git a/docs/src/content/docs/id/showcase.mdx b/docs/src/content/docs/id/showcase.mdx index e6e40cc39fd..b82bda9e712 100644 --- a/docs/src/content/docs/id/showcase.mdx +++ b/docs/src/content/docs/id/showcase.mdx @@ -10,7 +10,7 @@ Buka PR dan tambahkan link-nya ke halaman ini! ## Website -import ShowcaseSites from '../../../components/showcase-sites.astro'; +import ShowcaseSites from '~/components/showcase-sites.astro'; Starlight sudah digunakan dalam produksi. Berikut beberapa diantaranya: diff --git a/docs/src/content/docs/index.mdx b/docs/src/content/docs/index.mdx index 1b7de2b8b69..4b36d03be84 100644 --- a/docs/src/content/docs/index.mdx +++ b/docs/src/content/docs/index.mdx @@ -11,7 +11,7 @@ hero: title: Make your docs shine with Starlight tagline: Everything you need to build a stellar documentation website. Fast, accessible, and easy-to-use. image: - file: ../../assets/hero-star.webp + file: ~/assets/hero-star.webp actions: - text: Get started icon: right-arrow @@ -23,7 +23,7 @@ hero: --- import { CardGrid, Card } from '@astrojs/starlight/components'; -import AboutAstro from '../../components/about-astro.astro'; +import AboutAstro from '~/components/about-astro.astro'; diff --git a/docs/src/content/docs/it/guides/components.mdx b/docs/src/content/docs/it/guides/components.mdx index 07c6952a075..881d2271e48 100644 --- a/docs/src/content/docs/it/guides/components.mdx +++ b/docs/src/content/docs/it/guides/components.mdx @@ -147,7 +147,7 @@ import { LinkCard } from '@astrojs/starlight/components'; ### Icon import { Icon } from '@astrojs/starlight/components'; -import IconsList from '../../../../components/icons-list.astro'; +import IconsList from '~/components/icons-list.astro'; Starlight fornisce una serie di icone comuni che puoi visualizzare nei tuoi contenuti utilizzando il 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 index 8fc7a825812..97a57061d59 100644 --- a/docs/src/content/docs/it/guides/css-and-tailwind.mdx +++ b/docs/src/content/docs/it/guides/css-and-tailwind.mdx @@ -246,7 +246,7 @@ Le aree di anteprima scure e chiare mostreranno i colori risultanti e anche l'in 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'; +import ThemeDesigner from '~/components/theme-designer.astro'; diff --git a/docs/src/content/docs/it/guides/sidebar.mdx b/docs/src/content/docs/it/guides/sidebar.mdx index 7eb781fe69c..6f8b380f917 100644 --- a/docs/src/content/docs/it/guides/sidebar.mdx +++ b/docs/src/content/docs/it/guides/sidebar.mdx @@ -3,8 +3,8 @@ title: Navigazione nella barra laterale description: Scopri come impostare e personalizzare i collegamenti di navigazione della barra laterale del tuo sito Starlight. --- -import FileTree from '../../../../components/file-tree.astro'; -import SidebarPreview from '../../../../components/sidebar-preview.astro'; +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. diff --git a/docs/src/content/docs/it/index.mdx b/docs/src/content/docs/it/index.mdx index 7df08cf2334..2a161c755ef 100644 --- a/docs/src/content/docs/it/index.mdx +++ b/docs/src/content/docs/it/index.mdx @@ -11,7 +11,7 @@ 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. image: - file: ../../../assets/hero-star.webp + file: ~/assets/hero-star.webp actions: - text: Inizia icon: right-arrow @@ -23,7 +23,7 @@ hero: --- import { CardGrid, Card } from '@astrojs/starlight/components'; -import AboutAstro from '../../../components/about-astro.astro'; +import AboutAstro from '~/components/about-astro.astro'; diff --git a/docs/src/content/docs/it/manual-setup.mdx b/docs/src/content/docs/it/manual-setup.mdx index 0923e6cbad6..fffcbf009de 100644 --- a/docs/src/content/docs/it/manual-setup.mdx +++ b/docs/src/content/docs/it/manual-setup.mdx @@ -106,7 +106,7 @@ Per aggiungere tutte le pagine Starlight in un sottopercorso, posiziona tutto il 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'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/it/showcase.mdx b/docs/src/content/docs/it/showcase.mdx index a3351f3f87c..309890e131f 100644 --- a/docs/src/content/docs/it/showcase.mdx +++ b/docs/src/content/docs/it/showcase.mdx @@ -10,7 +10,7 @@ Apri una PR aggiungendo un link a questa pagina! ## Sites -import ShowcaseSites from '../../../components/showcase-sites.astro'; +import ShowcaseSites from '~/components/showcase-sites.astro'; Starlight è già utilizzato nella produzione. Questi sono alcuni dei siti presenti sul web: diff --git a/docs/src/content/docs/ja/getting-started.mdx b/docs/src/content/docs/ja/getting-started.mdx index c9d5b277f08..55f7ded2634 100644 --- a/docs/src/content/docs/ja/getting-started.mdx +++ b/docs/src/content/docs/ja/getting-started.mdx @@ -89,7 +89,7 @@ Starlightでは、設定なしでMarkdownとMDXを用いてコンテンツを作 たとえば、以下のファイル構造は、`example.com/hello-world`と`example.com/guides/faq`にページを生成します。 -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/ja/guides/components.mdx b/docs/src/content/docs/ja/guides/components.mdx index 17db47f7390..fef8f6a57a8 100644 --- a/docs/src/content/docs/ja/guides/components.mdx +++ b/docs/src/content/docs/ja/guides/components.mdx @@ -169,7 +169,7 @@ import { LinkCard } from '@astrojs/starlight/components'; ### アイコン import { Icon } from '@astrojs/starlight/components'; -import IconsList from '../../../../components/icons-list.astro'; +import IconsList from '~/components/icons-list.astro'; Starlightは、``コンポーネントを通じてコンテンツ内に表示可能な、一般的なアイコンのセットを提供しています。 diff --git a/docs/src/content/docs/ja/guides/css-and-tailwind.mdx b/docs/src/content/docs/ja/guides/css-and-tailwind.mdx index 30c77c8d88a..b8b2c3cda3e 100644 --- a/docs/src/content/docs/ja/guides/css-and-tailwind.mdx +++ b/docs/src/content/docs/ja/guides/css-and-tailwind.mdx @@ -241,7 +241,7 @@ Starlightのカラーテーマは、デフォルトのカスタムプロパテ 変更内容に満足できたら、以下のCSSまたはTailwindコードをコピーしてプロジェクトで使用します。 -import ThemeDesigner from '../../../../components/theme-designer.astro'; +import ThemeDesigner from '~/components/theme-designer.astro'; diff --git a/docs/src/content/docs/ja/guides/sidebar.mdx b/docs/src/content/docs/ja/guides/sidebar.mdx index 9851e35e01b..4b5cfe4d919 100644 --- a/docs/src/content/docs/ja/guides/sidebar.mdx +++ b/docs/src/content/docs/ja/guides/sidebar.mdx @@ -3,8 +3,8 @@ title: サイドバーのナビゲーション description: Starlightサイトのサイドバーのナビゲーションリンクを設定・カスタマイズする方法を学びます。 --- -import FileTree from '../../../../components/file-tree.astro'; -import SidebarPreview from '../../../../components/sidebar-preview.astro'; +import FileTree from '~/components/file-tree.astro'; +import SidebarPreview from '~/components/sidebar-preview.astro'; サイドバーはユーザーがサイト内を移動するための主要な方法の1つであるため、サイドバーを整理することは良いドキュメントの鍵となります。Starlightでは、サイドバーのレイアウトとコンテンツをカスタマイズするためのオプション一式を提供しています。 diff --git a/docs/src/content/docs/ja/index.mdx b/docs/src/content/docs/ja/index.mdx index 34f2f005a71..60dd998ffda 100644 --- a/docs/src/content/docs/ja/index.mdx +++ b/docs/src/content/docs/ja/index.mdx @@ -11,7 +11,7 @@ hero: title: Starlightでドキュメントを輝かせる tagline: 最高のドキュメントサイトを作るために必要なものがすべて揃っています。高速でアクセシブル、しかも使いやすさも備えます。 image: - file: ../../../assets/hero-star.webp + file: ~/assets/hero-star.webp actions: - text: はじめる icon: right-arrow @@ -23,7 +23,7 @@ hero: --- import { CardGrid, Card } from '@astrojs/starlight/components'; -import AboutAstro from '../../../components/about-astro.astro'; +import AboutAstro from '~/components/about-astro.astro'; diff --git a/docs/src/content/docs/ja/manual-setup.mdx b/docs/src/content/docs/ja/manual-setup.mdx index 22f4709d4af..feb9fa85f3c 100644 --- a/docs/src/content/docs/ja/manual-setup.mdx +++ b/docs/src/content/docs/ja/manual-setup.mdx @@ -103,7 +103,7 @@ Starlightのすべてのページをサブパスに追加するには、ドキ たとえば、Starlightのページがすべて`/guides/`で始まる場合は、コンテンツを`src/content/docs/guides/`ディレクトリに追加します。 -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/ja/reference/configuration.mdx b/docs/src/content/docs/ja/reference/configuration.mdx index 2d9e83c1a79..2746dd28805 100644 --- a/docs/src/content/docs/ja/reference/configuration.mdx +++ b/docs/src/content/docs/ja/reference/configuration.mdx @@ -302,7 +302,7 @@ starlight({ ### `social` -import SocialLinksType from '../../../../components/social-links-type.astro'; +import SocialLinksType from '~/components/social-links-type.astro'; **type:** diff --git a/docs/src/content/docs/ja/showcase.mdx b/docs/src/content/docs/ja/showcase.mdx index 9e31d1071c9..951cdeca4f6 100644 --- a/docs/src/content/docs/ja/showcase.mdx +++ b/docs/src/content/docs/ja/showcase.mdx @@ -9,7 +9,7 @@ Starlightサイトやプラグイン、あるいはStarlightのツールを作 ## サイト -import ShowcaseSites from '../../../components/showcase-sites.astro'; +import ShowcaseSites from '~/components/showcase-sites.astro'; Starlightはすでに本番環境で使用されています。以下はウェブ上のサイトの一部です。 diff --git a/docs/src/content/docs/ko/getting-started.mdx b/docs/src/content/docs/ko/getting-started.mdx index 9ba7a71a078..df43a909011 100644 --- a/docs/src/content/docs/ko/getting-started.mdx +++ b/docs/src/content/docs/ko/getting-started.mdx @@ -97,7 +97,7 @@ Starlight는 별도의 구성 없이 Markdown 및 MDX에서 콘텐츠를 작성 예를 들어, 다음 파일 구조는 `example.com/hello-world` 및 `example.com/guides/faq`에 페이지를 생성합니다. -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/ko/guides/components.mdx b/docs/src/content/docs/ko/guides/components.mdx index e51cb77cc39..82c8fe53c34 100644 --- a/docs/src/content/docs/ko/guides/components.mdx +++ b/docs/src/content/docs/ko/guides/components.mdx @@ -20,8 +20,8 @@ MDX 파일에서 컴포넌트를 가져온 다음 JSX 태그로 렌더링하여 title: 내 문서에 오신 것을 환영합니다 --- -import SomeComponent from '../../../components/SomeComponent.astro'; -import AnotherComponent from '../../../components/AnotherComponent.astro'; +import SomeComponent from '~/components/SomeComponent.astro'; +import AnotherComponent from '~/components/AnotherComponent.astro'; @@ -179,7 +179,7 @@ import { LinkCard } from '@astrojs/starlight/components'; ### 아이콘 import { Icon } from '@astrojs/starlight/components'; -import IconsList from '../../../../components/icons-list.astro'; +import IconsList from '~/components/icons-list.astro'; Starlight는 `` 컴포넌트를 사용하여 콘텐츠에 표시할 수 있는 공통 아이콘 세트를 제공합니다. diff --git a/docs/src/content/docs/ko/guides/css-and-tailwind.mdx b/docs/src/content/docs/ko/guides/css-and-tailwind.mdx index fdd34b9577b..076ee8ade98 100644 --- a/docs/src/content/docs/ko/guides/css-and-tailwind.mdx +++ b/docs/src/content/docs/ko/guides/css-and-tailwind.mdx @@ -243,7 +243,7 @@ export default { 변경 사항이 만족스러우면 아래 CSS 또는 Tailwind 코드를 복사하여 프로젝트에 사용하세요. -import ThemeDesigner from '../../../../components/theme-designer.astro'; +import ThemeDesigner from '~/components/theme-designer.astro'; diff --git a/docs/src/content/docs/ko/guides/sidebar.mdx b/docs/src/content/docs/ko/guides/sidebar.mdx index f868fe0362d..7c7825a2287 100644 --- a/docs/src/content/docs/ko/guides/sidebar.mdx +++ b/docs/src/content/docs/ko/guides/sidebar.mdx @@ -3,8 +3,8 @@ title: 사이드바 탐색 description: Starlight 사이트의 사이드바 탐색 링크를 설정하고 사용자 정의하는 방법을 알아보세요. --- -import FileTree from '../../../../components/file-tree.astro'; -import SidebarPreview from '../../../../components/sidebar-preview.astro'; +import FileTree from '~/components/file-tree.astro'; +import SidebarPreview from '~/components/sidebar-preview.astro'; 잘 구성된 사이드바는 사용자가 사이트를 탐색하는 주요 방법 중 하나이므로 좋은 문서의 핵심입니다. Starlight는 사이드바 레이아웃과 콘텐츠를 변경할 수 있는 완전한 옵션 세트를 제공합니다. diff --git a/docs/src/content/docs/ko/index.mdx b/docs/src/content/docs/ko/index.mdx index f82b3c8246c..5c79507f4b3 100644 --- a/docs/src/content/docs/ko/index.mdx +++ b/docs/src/content/docs/ko/index.mdx @@ -11,7 +11,7 @@ hero: title: Starlight로 멋진 문서를 만드세요 tagline: 아름다운 문서 웹 사이트를 만드는데 필요한 모든 것. 빠르고, 접근성이 좋으며 사용하기 쉽습니다. image: - file: ../../../assets/hero-star.webp + file: ~/assets/hero-star.webp actions: - text: 시작하기 icon: right-arrow @@ -23,7 +23,7 @@ hero: --- import { CardGrid, Card } from '@astrojs/starlight/components'; -import AboutAstro from '../../../components/about-astro.astro'; +import AboutAstro from '~/components/about-astro.astro'; diff --git a/docs/src/content/docs/ko/manual-setup.mdx b/docs/src/content/docs/ko/manual-setup.mdx index 0f80fe1024d..d0e2ac4623c 100644 --- a/docs/src/content/docs/ko/manual-setup.mdx +++ b/docs/src/content/docs/ko/manual-setup.mdx @@ -104,7 +104,7 @@ Starlight는 파일 기반 라우팅을 사용합니다. 즉, `src/content/docs/ 예를 들어, Starlight의 모든 페이지가 `/guides/`에서 시작해야 하는 경우 `src/content/docs/guides/` 디렉터리에 콘텐츠를 추가하세요. -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/ko/reference/configuration.mdx b/docs/src/content/docs/ko/reference/configuration.mdx index 62d1f18327d..c2275450d75 100644 --- a/docs/src/content/docs/ko/reference/configuration.mdx +++ b/docs/src/content/docs/ko/reference/configuration.mdx @@ -311,7 +311,7 @@ starlight({ ### `social` -import SocialLinksType from '../../../../components/social-links-type.astro'; +import SocialLinksType from '~/components/social-links-type.astro'; **타입:** diff --git a/docs/src/content/docs/ko/showcase.mdx b/docs/src/content/docs/ko/showcase.mdx index 17eb98a7d2d..f543a372cee 100644 --- a/docs/src/content/docs/ko/showcase.mdx +++ b/docs/src/content/docs/ko/showcase.mdx @@ -12,7 +12,7 @@ Starlight 사이트, 플러그인 또는 Starlight용 도구를 만드셨나요? ## 사이트 -import ShowcaseSites from '../../../components/showcase-sites.astro'; +import ShowcaseSites from '~/components/showcase-sites.astro'; Starlight는 이미 프로덕션에 사용되고 있습니다. 다음은 웹사이트 중 일부입니다. diff --git a/docs/src/content/docs/manual-setup.mdx b/docs/src/content/docs/manual-setup.mdx index eb83d10ef06..082325d6605 100644 --- a/docs/src/content/docs/manual-setup.mdx +++ b/docs/src/content/docs/manual-setup.mdx @@ -106,7 +106,7 @@ To add all Starlight pages at a subpath, place all your docs content inside a su For example, if Starlight pages should all start with `/guides/`, add your content in the `src/content/docs/guides/` directory: -import FileTree from '../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/pt-br/getting-started.mdx b/docs/src/content/docs/pt-br/getting-started.mdx index 1d62a63d5ca..791ed1f10ec 100644 --- a/docs/src/content/docs/pt-br/getting-started.mdx +++ b/docs/src/content/docs/pt-br/getting-started.mdx @@ -95,7 +95,7 @@ Utilize subdiretórios para organizar seus arquivos, e para criar múltiplos seg Por exemplo, a seguinte estrutura de arquivos vai gerar páginas `example.com/ola-mundo` e `example.com/guides/faq`: -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/pt-br/guides/components.mdx b/docs/src/content/docs/pt-br/guides/components.mdx index 565d4724d26..a432c68c899 100644 --- a/docs/src/content/docs/pt-br/guides/components.mdx +++ b/docs/src/content/docs/pt-br/guides/components.mdx @@ -179,7 +179,7 @@ import { LinkCard } from '@astrojs/starlight/components'; ### Ícone import { Icon } from '@astrojs/starlight/components'; -import IconsList from '../../../../components/icons-list.astro'; +import IconsList from '~/components/icons-list.astro'; Starlight providencia um conjunto comum de ícones que você pode mostrar em seu conteúdo utilizando o componente ``. diff --git a/docs/src/content/docs/pt-br/guides/css-and-tailwind.mdx b/docs/src/content/docs/pt-br/guides/css-and-tailwind.mdx index f72ac7badfb..dd0beabc480 100644 --- a/docs/src/content/docs/pt-br/guides/css-and-tailwind.mdx +++ b/docs/src/content/docs/pt-br/guides/css-and-tailwind.mdx @@ -245,7 +245,7 @@ As áreas de pré-visualização escura e clara irão mostrar as cores resultant Quando você estiver feliz com as mudanças, copie o código CSS ou Tailwind abaixo e use-o no seu projeto. -import ThemeDesigner from '../../../../components/theme-designer.astro'; +import ThemeDesigner from '~/components/theme-designer.astro'; diff --git a/docs/src/content/docs/pt-br/guides/sidebar.mdx b/docs/src/content/docs/pt-br/guides/sidebar.mdx index 4f2fe067a57..f9ad82e73e4 100644 --- a/docs/src/content/docs/pt-br/guides/sidebar.mdx +++ b/docs/src/content/docs/pt-br/guides/sidebar.mdx @@ -3,8 +3,8 @@ title: Navegação da barra lateral description: Aprenda como configurar e customizar os links de navegação da barra lateral de seu site Starlight. --- -import FileTree from '../../../../components/file-tree.astro'; -import SidebarPreview from '../../../../components/sidebar-preview.astro'; +import FileTree from '~/components/file-tree.astro'; +import SidebarPreview from '~/components/sidebar-preview.astro'; Uma barra lateral bem organizada é essencial para uma boa documentação por ser uma das principais maneiras que usuários vão navegar pelo seu site. Starlight provê um conjunto completo de opções para customizar o layout e conteúdo de sua barra lateral. diff --git a/docs/src/content/docs/pt-br/index.mdx b/docs/src/content/docs/pt-br/index.mdx index 73bebaa5c5e..511977e82f0 100644 --- a/docs/src/content/docs/pt-br/index.mdx +++ b/docs/src/content/docs/pt-br/index.mdx @@ -11,7 +11,7 @@ hero: title: Faça sua documentação brilhar com Starlight tagline: Tudo o que você precisa para construir um site de documentação brilhante. Rápido, acessível e fácil de usar. image: - file: ../../../assets/hero-star.webp + file: ~/assets/hero-star.webp actions: - text: Começar icon: right-arrow @@ -23,7 +23,7 @@ hero: --- import { CardGrid, Card } from '@astrojs/starlight/components'; -import AboutAstro from '../../../components/about-astro.astro'; +import AboutAstro from '~/components/about-astro.astro'; diff --git a/docs/src/content/docs/pt-br/manual-setup.mdx b/docs/src/content/docs/pt-br/manual-setup.mdx index 58e747950dc..54956fa0e63 100644 --- a/docs/src/content/docs/pt-br/manual-setup.mdx +++ b/docs/src/content/docs/pt-br/manual-setup.mdx @@ -106,7 +106,7 @@ Para adicionar todas as páginas do Starlight em um subcaminho, coloque todo o c Por exemplo, se todas as páginas do Starlight devem começar com `/guias/`, adicione seu conteúdo no diretório `src/content/docs/guias/`: -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/pt-br/reference/configuration.mdx b/docs/src/content/docs/pt-br/reference/configuration.mdx index 5e09086ba03..9396f1db48f 100644 --- a/docs/src/content/docs/pt-br/reference/configuration.mdx +++ b/docs/src/content/docs/pt-br/reference/configuration.mdx @@ -307,7 +307,7 @@ O local padrãoserá utilizado para providenciar conteúdo de fallback onde est ### `social` -import SocialLinksType from '../../../../components/social-links-type.astro'; +import SocialLinksType from '~/components/social-links-type.astro'; **tipo:** diff --git a/docs/src/content/docs/pt-br/showcase.mdx b/docs/src/content/docs/pt-br/showcase.mdx index 087dc06131e..f1cdb39bf82 100644 --- a/docs/src/content/docs/pt-br/showcase.mdx +++ b/docs/src/content/docs/pt-br/showcase.mdx @@ -10,7 +10,7 @@ Abra um PR adicionando um link a esta página! ## Sites -import ShowcaseSites from '../../../components/showcase-sites.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: diff --git a/docs/src/content/docs/reference/configuration.mdx b/docs/src/content/docs/reference/configuration.mdx index c3bc97abc5c..7d21d29f226 100644 --- a/docs/src/content/docs/reference/configuration.mdx +++ b/docs/src/content/docs/reference/configuration.mdx @@ -307,7 +307,7 @@ The default locale will be used to provide fallback content where translations a ### `social` -import SocialLinksType from '../../../components/social-links-type.astro'; +import SocialLinksType from '~/components/social-links-type.astro'; **type:** diff --git a/docs/src/content/docs/reference/frontmatter.md b/docs/src/content/docs/reference/frontmatter.md index 3df85b4c224..8e11bea0c58 100644 --- a/docs/src/content/docs/reference/frontmatter.md +++ b/docs/src/content/docs/reference/frontmatter.md @@ -110,7 +110,7 @@ hero: tagline: Take your stuff to the moon and back in the blink of an eye. image: alt: A glittering, brightly colored logo - file: ../../assets/logo.png + file: ~/assets/logo.png actions: - text: Tell me more link: /getting-started/ @@ -130,8 +130,8 @@ You can display different versions of the hero image in light and dark modes. hero: image: alt: A glittering, brightly colored logo - dark: ../../assets/logo-dark.png - light: ../../assets/logo-light.png + dark: ~/assets/logo-dark.png + light: ~/assets/logo-light.png --- ``` diff --git a/docs/src/content/docs/ru/guides/components.mdx b/docs/src/content/docs/ru/guides/components.mdx index e8cbede3620..249e1485070 100644 --- a/docs/src/content/docs/ru/guides/components.mdx +++ b/docs/src/content/docs/ru/guides/components.mdx @@ -175,7 +175,7 @@ import { LinkCard } from '@astrojs/starlight/components'; ### Иконки import { Icon } from '@astrojs/starlight/components'; -import IconsList from '../../../../components/icons-list.astro'; +import IconsList from '~/components/icons-list.astro'; Starlight предоставляет набор общих иконок, которые вы можете отображать в своем контенте, используя компонент ``. diff --git a/docs/src/content/docs/ru/guides/css-and-tailwind.mdx b/docs/src/content/docs/ru/guides/css-and-tailwind.mdx index f21a4b4b720..6c29c948338 100644 --- a/docs/src/content/docs/ru/guides/css-and-tailwind.mdx +++ b/docs/src/content/docs/ru/guides/css-and-tailwind.mdx @@ -247,7 +247,7 @@ module.exports = { Когда вы довольны внесенными изменениями, скопируйте CSS или код Tailwind ниже и используйте его в вашем проекте. -import ThemeDesigner from '../../../../components/theme-designer.astro'; +import ThemeDesigner from '~/components/theme-designer.astro'; diff --git a/docs/src/content/docs/ru/guides/sidebar.mdx b/docs/src/content/docs/ru/guides/sidebar.mdx index 60127dc16d7..39919ca877e 100644 --- a/docs/src/content/docs/ru/guides/sidebar.mdx +++ b/docs/src/content/docs/ru/guides/sidebar.mdx @@ -3,8 +3,8 @@ title: Боковая панель description: Узнайте, как настроить и настроить ссылки боковой панели навигации вашего сайта Starlight. --- -import FileTree from '../../../../components/file-tree.astro'; -import SidebarPreview from '../../../../components/sidebar-preview.astro'; +import FileTree from '~/components/file-tree.astro'; +import SidebarPreview from '~/components/sidebar-preview.astro'; Хорошо организованная боковая панель ключевой параметр хорошей документации, поскольку это один из основных способов, которыми пользователи будут перемещаться по вашему сайту. Starlight предоставляет полный набор опций для настройки макета и содержимого вашей боковой панели. diff --git a/docs/src/content/docs/ru/index.mdx b/docs/src/content/docs/ru/index.mdx index ae2d8c87ff9..8d449cdd7f4 100644 --- a/docs/src/content/docs/ru/index.mdx +++ b/docs/src/content/docs/ru/index.mdx @@ -11,7 +11,7 @@ hero: title: Сделайте свою документацию яркой с помощью Starlight tagline: Все, что вам нужно, чтобы создать впечатляющий сайт с документацией. Быстро, доступно и просто в использовании. image: - file: ../../../assets/hero-star.webp + file: ~/assets/hero-star.webp actions: - text: Начать icon: right-arrow @@ -23,7 +23,7 @@ hero: --- import { CardGrid, Card } from '@astrojs/starlight/components'; -import AboutAstro from '../../../components/about-astro.astro'; +import AboutAstro from '~/components/about-astro.astro'; diff --git a/docs/src/content/docs/ru/manual-setup.mdx b/docs/src/content/docs/ru/manual-setup.mdx index df036238373..5c49b6918de 100644 --- a/docs/src/content/docs/ru/manual-setup.mdx +++ b/docs/src/content/docs/ru/manual-setup.mdx @@ -112,7 +112,7 @@ Starlight использует роутинг на основе файлов, ч Например, если все страницы Starlight должны начинаться с `/guides/`, добавьте свой контент в директорию `src/content/docs/guides/`: -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/ru/showcase.mdx b/docs/src/content/docs/ru/showcase.mdx index c3643ffd95a..82203cb2e73 100644 --- a/docs/src/content/docs/ru/showcase.mdx +++ b/docs/src/content/docs/ru/showcase.mdx @@ -10,7 +10,7 @@ description: Откройте для себя сайты, созданные н ## Сайты -import ShowcaseSites from '../../../components/showcase-sites.astro'; +import ShowcaseSites from '~/components/showcase-sites.astro'; Starlight уже используется в продакшне. Вот некоторые сайты в вебе, которые используют Starlight: diff --git a/docs/src/content/docs/showcase.mdx b/docs/src/content/docs/showcase.mdx index e3e65bd40cd..e7b0bead913 100644 --- a/docs/src/content/docs/showcase.mdx +++ b/docs/src/content/docs/showcase.mdx @@ -10,7 +10,7 @@ Open a PR adding a link to this page! ## Sites -import ShowcaseSites from '../../components/showcase-sites.astro'; +import ShowcaseSites from '~/components/showcase-sites.astro'; Starlight is already being used in production. These are some of the sites around the web: diff --git a/docs/src/content/docs/tr/guides/components.mdx b/docs/src/content/docs/tr/guides/components.mdx index 7774fdc42a2..86b1136fc77 100644 --- a/docs/src/content/docs/tr/guides/components.mdx +++ b/docs/src/content/docs/tr/guides/components.mdx @@ -167,7 +167,7 @@ import { LinkCard } from '@astrojs/starlight/components'; ### İkon import { Icon } from '@astrojs/starlight/components'; -import IconsList from '../../../../components/icons-list.astro'; +import IconsList from '~/components/icons-list.astro'; Starlight, içeriğinizde görünmesi için `` bileşenini kullanarak bir grup ortak ikonları kullanımınıza sunar. Her `` [`name`](#tüm-i̇konlar) değerine ihtiyaç duyar ve isteğe bağlı olarak `label`, `size`, ve `color` özellikleri eklenebilir. diff --git a/docs/src/content/docs/tr/guides/project-structure.mdx b/docs/src/content/docs/tr/guides/project-structure.mdx index e1dc726af62..b9dc04995f0 100644 --- a/docs/src/content/docs/tr/guides/project-structure.mdx +++ b/docs/src/content/docs/tr/guides/project-structure.mdx @@ -20,7 +20,7 @@ Starlight projeleri, diğer Astro projelerinde olduğu gibi aynı dosya ve dizin Bir Starlight projesi dizini bunun gibi görülebilir: -import FileTree from '../../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/tr/guides/sidebar.mdx b/docs/src/content/docs/tr/guides/sidebar.mdx index 9309c62be00..2b1a7e603ef 100644 --- a/docs/src/content/docs/tr/guides/sidebar.mdx +++ b/docs/src/content/docs/tr/guides/sidebar.mdx @@ -3,8 +3,8 @@ title: Kenar Çubuğu Gezintileri description: Starlight sitenizin kenar çubuğunu nasıl kuracağınızı ve özelleştireceğinizi öğrenin. --- -import FileTree from '../../../../components/file-tree.astro'; -import SidebarPreview from '../../../../components/sidebar-preview.astro'; +import FileTree from '~/components/file-tree.astro'; +import SidebarPreview from '~/components/sidebar-preview.astro'; İyi düzenlenmiş bir kenar çubuğu, kullanıcılarınızın sitenizde gezinti yapabileceği iyi bir dokümantasyonun anahtarıdır. Starlight kenar çubuğunuzun taslağı ve içeriğini özelleştirebileceğiniz ayarlar sunar. diff --git a/docs/src/content/docs/tr/index.mdx b/docs/src/content/docs/tr/index.mdx index bf737443587..8c588c0599a 100644 --- a/docs/src/content/docs/tr/index.mdx +++ b/docs/src/content/docs/tr/index.mdx @@ -11,7 +11,7 @@ hero: title: Starlight ile dokümanlarınız şıkır şıkır olsun tagline: Yıldız gibi dokümantasyon sitesi oluşturmanız için gereken her şey. Hızlı, erişilebilir ve kullanımı kolay. image: - file: ../../../assets/hero-star.webp + file: ~/assets/hero-star.webp actions: - text: Başla icon: right-arrow @@ -23,7 +23,7 @@ hero: --- import { CardGrid, Card } from '@astrojs/starlight/components'; -import AboutAstro from '../../../components/about-astro.astro'; +import AboutAstro from '~/components/about-astro.astro'; diff --git a/docs/src/content/docs/tr/manual-setup.mdx b/docs/src/content/docs/tr/manual-setup.mdx index da58cec0195..1d63c2c2ddd 100644 --- a/docs/src/content/docs/tr/manual-setup.mdx +++ b/docs/src/content/docs/tr/manual-setup.mdx @@ -106,7 +106,7 @@ Tüm Starlight sayfalarını alt kırılımda eklemek için `src/content/docs/` Örneğin, Starlight sayfaların `/guides/` kırılımıyla başlaması gerekiyorsa, içeriklerini `src/content/docs/guides/` dizininde ekle: -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/tr/showcase.mdx b/docs/src/content/docs/tr/showcase.mdx index 19724eeeb58..38a217b5c66 100644 --- a/docs/src/content/docs/tr/showcase.mdx +++ b/docs/src/content/docs/tr/showcase.mdx @@ -10,7 +10,7 @@ Bu sayfaya bağlantı ekleyerek PR aç! ## Siteler -import ShowcaseSites from '../../../components/showcase-sites.astro'; +import ShowcaseSites from '~/components/showcase-sites.astro'; Starlight halihazırda yayında kullanılıyor. Web'deki bazı web siteler: diff --git a/docs/src/content/docs/uk/getting-started.mdx b/docs/src/content/docs/uk/getting-started.mdx index ede3748227c..0dbe4d83583 100644 --- a/docs/src/content/docs/uk/getting-started.mdx +++ b/docs/src/content/docs/uk/getting-started.mdx @@ -95,7 +95,7 @@ Starlight підтримує створення контенту у формат Наприклад, оттака структура файлів зґенерує сторінки за адресами `example.com/hello-world` і `example.com/guides/faq`: -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/uk/index.mdx b/docs/src/content/docs/uk/index.mdx index 3ab78d9e197..72620c96988 100644 --- a/docs/src/content/docs/uk/index.mdx +++ b/docs/src/content/docs/uk/index.mdx @@ -11,7 +11,7 @@ hero: title: Осяйте вашу документацію зі Starlight tagline: Усе, що треба для створення блискучого документаційного сайту. Швидко, доступно та просто в користуванні. image: - file: ../../../assets/hero-star.webp + file: ~/assets/hero-star.webp actions: - text: Розпочати icon: right-arrow @@ -23,7 +23,7 @@ hero: --- import { CardGrid, Card } from '@astrojs/starlight/components'; -import AboutAstro from '../../../components/about-astro.astro'; +import AboutAstro from '~/components/about-astro.astro'; diff --git a/docs/src/content/docs/uk/showcase.mdx b/docs/src/content/docs/uk/showcase.mdx index 76ae2068df1..4126fbb741c 100644 --- a/docs/src/content/docs/uk/showcase.mdx +++ b/docs/src/content/docs/uk/showcase.mdx @@ -10,7 +10,7 @@ description: Відкрийте сайти, створені зі Starlight, т ## Сайти -import ShowcaseSites from '../../../components/showcase-sites.astro'; +import ShowcaseSites from '~/components/showcase-sites.astro'; Starlight уже використовується в продакшені. Ось деякі сайти в мережі: diff --git a/docs/src/content/docs/zh-cn/getting-started.mdx b/docs/src/content/docs/zh-cn/getting-started.mdx index b0c02e3e7e1..66dd9b98234 100644 --- a/docs/src/content/docs/zh-cn/getting-started.mdx +++ b/docs/src/content/docs/zh-cn/getting-started.mdx @@ -95,7 +95,7 @@ Starlight 支持使用 Markdown 和 MDX 编写内容,无需进行任何配置 例如,以下文件结构将在 `example.com/hello-world` 和 `example.com/guides/faq` 生成页面: -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/zh-cn/guides/components.mdx b/docs/src/content/docs/zh-cn/guides/components.mdx index 1f863138fe3..700278f5372 100644 --- a/docs/src/content/docs/zh-cn/guides/components.mdx +++ b/docs/src/content/docs/zh-cn/guides/components.mdx @@ -20,8 +20,8 @@ Starlight 支持在 [MDX](https://mdxjs.com/) 文件中使用组件,并提供 title: 欢迎来到我的文档 --- -import SomeComponent from '../../../components/SomeComponent.astro'; -import AnotherComponent from '../../../components/AnotherComponent.astro'; +import SomeComponent from '~/components/SomeComponent.astro'; +import AnotherComponent from '~/components/AnotherComponent.astro'; @@ -171,7 +171,7 @@ import { LinkCard } from '@astrojs/starlight/components'; ### 图标 import { Icon } from '@astrojs/starlight/components'; -import IconsList from '../../../../components/icons-list.astro'; +import IconsList from '~/components/icons-list.astro'; Starlight 提供了一组常用的图标,你可以使用 `` 组件在你的内容中显示。 diff --git a/docs/src/content/docs/zh-cn/guides/css-and-tailwind.mdx b/docs/src/content/docs/zh-cn/guides/css-and-tailwind.mdx index b0c527ed04f..f24c2f0ead2 100644 --- a/docs/src/content/docs/zh-cn/guides/css-and-tailwind.mdx +++ b/docs/src/content/docs/zh-cn/guides/css-and-tailwind.mdx @@ -244,7 +244,7 @@ Starlight 的颜色主题可以通过覆盖其默认的自定义属性来控制 当你对你的更改满意时,复制下面的 CSS 或 Tailwind 代码并在你的项目中使用。 -import ThemeDesigner from '../../../../components/theme-designer.astro'; +import ThemeDesigner from '~/components/theme-designer.astro'; diff --git a/docs/src/content/docs/zh-cn/guides/sidebar.mdx b/docs/src/content/docs/zh-cn/guides/sidebar.mdx index 36dbf96dbb9..1fa2e468021 100644 --- a/docs/src/content/docs/zh-cn/guides/sidebar.mdx +++ b/docs/src/content/docs/zh-cn/guides/sidebar.mdx @@ -3,8 +3,8 @@ title: 侧边栏导航 description: 了解如何设置和自定义 Starlight 站点的侧边栏导航链接。 --- -import FileTree from '../../../../components/file-tree.astro'; -import SidebarPreview from '../../../../components/sidebar-preview.astro'; +import FileTree from '~/components/file-tree.astro'; +import SidebarPreview from '~/components/sidebar-preview.astro'; 一个组织良好的侧边栏是良好文档的关键,因为它是用户浏览你的站点的主要方式之一。Starlight 提供了一整套选项来自定义侧边栏布局和内容。 diff --git a/docs/src/content/docs/zh-cn/index.mdx b/docs/src/content/docs/zh-cn/index.mdx index f0a2b44c21e..0aa39ae35fa 100644 --- a/docs/src/content/docs/zh-cn/index.mdx +++ b/docs/src/content/docs/zh-cn/index.mdx @@ -11,7 +11,7 @@ hero: title: Starlight
使你的文档闪耀夺目 tagline: 快速、易用、易于访问 —— 构建卓越文档网站所需的一切。 image: - file: ../../../assets/hero-star.webp + file: ~/assets/hero-star.webp actions: - text: 开始使用 icon: right-arrow @@ -23,7 +23,7 @@ hero: --- import { CardGrid, Card } from '@astrojs/starlight/components'; -import AboutAstro from '../../../components/about-astro.astro'; +import AboutAstro from '~/components/about-astro.astro'; diff --git a/docs/src/content/docs/zh-cn/manual-setup.mdx b/docs/src/content/docs/zh-cn/manual-setup.mdx index 4c2fadf2522..21b272a29aa 100644 --- a/docs/src/content/docs/zh-cn/manual-setup.mdx +++ b/docs/src/content/docs/zh-cn/manual-setup.mdx @@ -105,7 +105,7 @@ Starlight 使用基于文件的路由,这意味着 `src/content/docs/` 中的 例如,如果 Starlight 页面都应该以 `/guides/` 开头,请将内容添加到 `src/content/docs/guides/` 目录中: -import FileTree from '../../../components/file-tree.astro'; +import FileTree from '~/components/file-tree.astro'; diff --git a/docs/src/content/docs/zh-cn/reference/configuration.mdx b/docs/src/content/docs/zh-cn/reference/configuration.mdx index f2041de7508..a9134099da8 100644 --- a/docs/src/content/docs/zh-cn/reference/configuration.mdx +++ b/docs/src/content/docs/zh-cn/reference/configuration.mdx @@ -305,7 +305,7 @@ starlight({ ### `social` -import SocialLinksType from '../../../../components/social-links-type.astro'; +import SocialLinksType from '~/components/social-links-type.astro'; **类型:** diff --git a/docs/src/content/docs/zh-cn/showcase.mdx b/docs/src/content/docs/zh-cn/showcase.mdx index aed2b9f2fc5..4e3a224727f 100644 --- a/docs/src/content/docs/zh-cn/showcase.mdx +++ b/docs/src/content/docs/zh-cn/showcase.mdx @@ -9,7 +9,7 @@ description: 发现使用 Starlight 构建的网站和扩展 Starlight 的社区 ## 网站 -import ShowcaseSites from '../../../components/showcase-sites.astro'; +import ShowcaseSites from '~/components/showcase-sites.astro'; Starlight 已投入生产。 这些是网络上的一些网站: diff --git a/docs/tsconfig.json b/docs/tsconfig.json index fbc2f5fc190..04c1c278b8b 100644 --- a/docs/tsconfig.json +++ b/docs/tsconfig.json @@ -1,3 +1,9 @@ { - "extends": "astro/tsconfigs/strictest" + "extends": "astro/tsconfigs/strictest", + "compilerOptions": { + "baseUrl": ".", + "paths": { + "~/*": ["src/*"] + } + } } diff --git a/packages/starlight/__tests__/basics/git.test.ts b/packages/starlight/__tests__/basics/git.test.ts new file mode 100644 index 00000000000..1f194f285c7 --- /dev/null +++ b/packages/starlight/__tests__/basics/git.test.ts @@ -0,0 +1,117 @@ +import { mkdtempSync, writeFileSync } from 'node:fs'; +import { join } from 'node:path'; +import { tmpdir } from 'node:os'; +import { spawnSync } from 'node:child_process'; +import { describe, expect, test } from 'vitest'; +import { getNewestCommitDate } from '../../utils/git'; + +describe('getNewestCommitDate', () => { + const { commitAllChanges, getFilePath, writeFile } = makeTestRepo(); + + test('returns the newest commit date', () => { + const file = 'updated.md'; + const lastCommitDate = '2023-06-25'; + + writeFile(file, 'content 0'); + commitAllChanges('add updated.md', '2023-06-21'); + writeFile(file, 'content 1'); + commitAllChanges('update updated.md', lastCommitDate); + + expectCommitDateToEqual(getNewestCommitDate(getFilePath(file)), lastCommitDate); + }); + + test('returns the initial commit date for a file never updated', () => { + const file = 'added.md'; + const commitDate = '2022-09-18'; + + writeFile(file, 'content'); + commitAllChanges('add added.md', commitDate); + + expectCommitDateToEqual(getNewestCommitDate(getFilePath(file)), commitDate); + }); + + test('returns the newest commit date for a file with a name that contains a space', () => { + const file = 'updated with space.md'; + const lastCommitDate = '2021-01-02'; + + writeFile(file, 'content 0'); + commitAllChanges('add updated.md', '2021-01-01'); + writeFile(file, 'content 1'); + commitAllChanges('update updated.md', lastCommitDate); + + expectCommitDateToEqual(getNewestCommitDate(getFilePath(file)), lastCommitDate); + }); + + test('returns the newest commit date for a file updated the same day', () => { + const file = 'updated-same-day.md'; + const lastCommitDate = '2023-06-25T14:22:35Z'; + + writeFile(file, 'content 0'); + commitAllChanges('add updated.md', '2023-06-25T12:34:56Z'); + writeFile(file, 'content 1'); + commitAllChanges('update updated.md', lastCommitDate); + + expectCommitDateToEqual(getNewestCommitDate(getFilePath(file)), lastCommitDate); + }); + + test('throws when failing to retrieve the git history for a file', () => { + expect(() => getNewestCommitDate(getFilePath('../not-a-starlight-test-repo/test.md'))).toThrow( + /^Failed to retrieve the git history for file "[/\\-\w ]+\/test\.md"/ + ); + }); + + test('throws when trying to get the history of a non-existing or untracked file', () => { + const expectedError = + /^Failed to validate the timestamp for file "[/\\-\w ]+\/(?:unknown|untracked)\.md"$/; + writeFile('untracked.md', 'content'); + + expect(() => getNewestCommitDate(getFilePath('unknown.md'))).toThrow(expectedError); + expect(() => getNewestCommitDate(getFilePath('untracked.md'))).toThrow(expectedError); + }); +}); + +function expectCommitDateToEqual(commitDate: CommitDate, expectedDateStr: ISODate) { + const expectedDate = new Date(expectedDateStr); + expect(commitDate).toStrictEqual(expectedDate); +} + +function makeTestRepo() { + const repoPath = mkdtempSync(join(tmpdir(), 'starlight-test-git-')); + + function runInRepo(command: string, args: string[], env: NodeJS.ProcessEnv = {}) { + const result = spawnSync(command, args, { cwd: repoPath, env }); + + if (result.status !== 0) { + throw new Error(`Failed to execute test repository command: '${command} ${args.join(' ')}'`); + } + } + + // Configure git specifically for this test repository. + runInRepo('git', ['init']); + runInRepo('git', ['config', 'user.name', 'starlight-test']); + runInRepo('git', ['config', 'user.email', 'starlight-test@example.com']); + runInRepo('git', ['config', 'commit.gpgsign', 'false']); + + return { + // The `dateStr` argument should be in the `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ` format. + commitAllChanges(message: string, dateStr: ISODate) { + const date = dateStr.endsWith('Z') ? dateStr : `${dateStr}T00:00:00Z`; + + runInRepo('git', ['add', '-A']); + // This sets both the author and committer dates to the provided date. + runInRepo('git', ['commit', '-m', message, '--date', date], { GIT_COMMITTER_DATE: date }); + }, + getFilePath(name: string) { + return join(repoPath, name); + }, + writeFile(name: string, content: string) { + writeFileSync(join(repoPath, name), content); + }, + }; +} + +type ISODate = + | `${number}-${number}-${number}` + | `${number}-${number}-${number}T${number}:${number}:${number}Z`; + +type CommitDate = ReturnType; diff --git a/packages/starlight/__tests__/i18n-root-locale/routing.test.ts b/packages/starlight/__tests__/i18n-root-locale/routing.test.ts index b7fbd0201c6..c6824349091 100644 --- a/packages/starlight/__tests__/i18n-root-locale/routing.test.ts +++ b/packages/starlight/__tests__/i18n-root-locale/routing.test.ts @@ -68,7 +68,7 @@ test('fallback routes use their own locale data', () => { }); test('fallback routes use fallback entry last updated dates', () => { - const getFileCommitDate = vi.spyOn(git, 'getFileCommitDate'); + const getNewestCommitDate = vi.spyOn(git, 'getNewestCommitDate'); const route = routes.find((route) => route.entry.id === routes[4]!.id && route.locale === 'en'); assert(route, 'Expected to find English fallback route for `guides/authoring-content.md`.'); @@ -80,11 +80,11 @@ test('fallback routes use fallback entry last updated dates', () => { url: new URL('https://example.com/en'), }); - expect(getFileCommitDate).toHaveBeenCalledOnce(); - expect(getFileCommitDate.mock.lastCall?.[0]).toMatch( + expect(getNewestCommitDate).toHaveBeenCalledOnce(); + expect(getNewestCommitDate.mock.lastCall?.[0]).toMatch( /src\/content\/docs\/guides\/authoring-content.md$/ // ^ no `en/` prefix ); - getFileCommitDate.mockRestore(); + getNewestCommitDate.mockRestore(); }); diff --git a/packages/starlight/package.json b/packages/starlight/package.json index c6ff2ede7d3..44d00414bc6 100644 --- a/packages/starlight/package.json +++ b/packages/starlight/package.json @@ -180,7 +180,6 @@ "@types/mdast": "^4.0.3", "astro-expressive-code": "^0.30.1", "bcp-47": "^2.1.0", - "execa": "^8.0.1", "hast-util-select": "^6.0.2", "hastscript": "^8.0.0", "mdast-util-directive": "^3.0.0", diff --git a/packages/starlight/translations/it.json b/packages/starlight/translations/it.json index 4b41c78b472..6ed498b4f4a 100644 --- a/packages/starlight/translations/it.json +++ b/packages/starlight/translations/it.json @@ -3,7 +3,7 @@ "search.label": "Cerca", "search.shortcutLabel": "(Usa / per cercare)", "search.cancelLabel": "Cancella", - "search.devWarning": "Search is only available in production builds. \nTry building and previewing the site to test it out locally.", + "search.devWarning": "La ricerca è disponibile solo nelle build di produzione. \nProvare ad eseguire il processo di build e visualizzare la preview del sito per testarlo localmente.", "themeSelect.accessibleLabel": "Seleziona tema", "themeSelect.dark": "Scuro", "themeSelect.light": "Chiaro", diff --git a/packages/starlight/utils/git.ts b/packages/starlight/utils/git.ts index 15d802f71b5..d69bd259eac 100644 --- a/packages/starlight/utils/git.ts +++ b/packages/starlight/utils/git.ts @@ -1,74 +1,24 @@ -/** - * Heavily inspired by - * https://github.com/facebook/docusaurus/blob/46d2aa231ddb18ed67311b6195260af46d7e8bdc/packages/docusaurus-utils/src/gitUtils.ts - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - import { basename, dirname } from 'node:path'; -import { execaSync } from 'execa'; +import { spawnSync } from 'node:child_process'; -/** Custom error thrown when the current file is not tracked by git. */ -class FileNotTrackedError extends Error {} +export function getNewestCommitDate(file: string) { + const result = spawnSync('git', ['log', '--format=%ct', '--max-count=1', basename(file)], { + cwd: dirname(file), + encoding: 'utf-8', + }); -/** - * Fetches the git history of a file and returns a relevant commit date. - * It gets the commit date instead of author date so that amended commits - * can have their dates updated. - * - * @throws {FileNotTrackedError} If the current file is not tracked by git. - * @throws Also throws when `git log` exited with non-zero, or when it outputs - * unexpected text. - */ -export function getFileCommitDate( - file: string, - age: 'oldest' | 'newest' = 'oldest' -): { - date: Date; - timestamp: number; -} { - const result = execaSync( - 'git', - [ - 'log', - `--format=%ct`, - '--max-count=1', - ...(age === 'oldest' ? ['--follow', '--diff-filter=A'] : []), - '--', - basename(file), - ], - { - cwd: dirname(file), - } - ); - if (result.exitCode !== 0) { - throw new Error( - `Failed to retrieve the git history for file "${file}" with exit code ${result.exitCode}: ${result.stderr}` - ); + if (result.error) { + throw new Error(`Failed to retrieve the git history for file "${file}"`); } - const output = result.stdout.trim(); - - if (!output) { - throw new FileNotTrackedError( - `Failed to retrieve the git history for file "${file}" because the file is not tracked by git.` - ); - } - const regex = /^(?\d+)$/; const match = output.match(regex); - if (!match) { - throw new Error( - `Failed to retrieve the git history for file "${file}" with unexpected output: ${output}` - ); + if (!match?.groups?.timestamp) { + throw new Error(`Failed to validate the timestamp for file "${file}"`); } - const timestamp = Number(match.groups!.timestamp); + const timestamp = Number(match.groups.timestamp); const date = new Date(timestamp * 1000); - - return { date, timestamp }; + return date; } diff --git a/packages/starlight/utils/route-data.ts b/packages/starlight/utils/route-data.ts index 484fea08d52..b7a23e6c445 100644 --- a/packages/starlight/utils/route-data.ts +++ b/packages/starlight/utils/route-data.ts @@ -3,7 +3,7 @@ import { fileURLToPath } from 'node:url'; import project from 'virtual:starlight/project-context'; import config from 'virtual:starlight/user-config'; import { generateToC, type TocItem } from './generateToC'; -import { getFileCommitDate } from './git'; +import { getNewestCommitDate } from './git'; import { getPrevNextLinks, getSidebar, type SidebarEntry } from './navigation'; import { ensureTrailingSlash } from './path'; import type { Route } from './routing'; @@ -70,17 +70,22 @@ function getToC({ entry, locale, headings }: PageProps) { } function getLastUpdated({ entry }: PageProps): Date | undefined { - if (entry.data.lastUpdated ?? config.lastUpdated) { + const { lastUpdated: frontmatterLastUpdated } = entry.data; + const { lastUpdated: configLastUpdated } = config; + + if (frontmatterLastUpdated ?? configLastUpdated) { const currentFilePath = fileURLToPath(new URL('src/content/docs/' + entry.id, project.root)); - let date = typeof entry.data.lastUpdated !== 'boolean' ? entry.data.lastUpdated : undefined; - if (!date) { - try { - ({ date } = getFileCommitDate(currentFilePath, 'newest')); - } catch {} + try { + return frontmatterLastUpdated instanceof Date + ? frontmatterLastUpdated + : getNewestCommitDate(currentFilePath); + } catch { + // If the git command fails, ignore the error. + return undefined; } - return date; } - return; + + return undefined; } function getEditUrl({ entry, id, isFallback }: PageProps): URL | undefined { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 07b41e11461..b9203313d54 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -147,9 +147,6 @@ importers: bcp-47: specifier: ^2.1.0 version: 2.1.0 - execa: - specifier: ^8.0.1 - version: 8.0.1 hast-util-select: specifier: ^6.0.2 version: 6.0.2