diff --git a/.changeset/clean-squids-sparkle.md b/.changeset/clean-squids-sparkle.md deleted file mode 100644 index 238e3baddc..0000000000 --- a/.changeset/clean-squids-sparkle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/starlight': patch ---- - -Fixes aside custom titles rendering for nested asides. diff --git a/.changeset/healthy-boxes-smoke.md b/.changeset/healthy-boxes-smoke.md new file mode 100644 index 0000000000..dae50cb1f9 --- /dev/null +++ b/.changeset/healthy-boxes-smoke.md @@ -0,0 +1,5 @@ +--- +'@astrojs/starlight': patch +--- + +Adds Russian translations for Expressive Code labels diff --git a/.changeset/spotty-eggs-sit.md b/.changeset/spotty-eggs-sit.md new file mode 100644 index 0000000000..62d5b0c85e --- /dev/null +++ b/.changeset/spotty-eggs-sit.md @@ -0,0 +1,5 @@ +--- +'@astrojs/starlight': patch +--- + +Fixes type inference for i18n strings added by extending the default schema diff --git a/.changeset/spotty-mice-travel.md b/.changeset/spotty-mice-travel.md new file mode 100644 index 0000000000..102f2e191a --- /dev/null +++ b/.changeset/spotty-mice-travel.md @@ -0,0 +1,5 @@ +--- +'@astrojs/starlight': patch +--- + +Fixes an issue where TypeScript could fail to serialize the frontmatter schema when configured to emit declaration files diff --git a/.changeset/strong-moose-jam.md b/.changeset/strong-moose-jam.md new file mode 100644 index 0000000000..4f054c5be1 --- /dev/null +++ b/.changeset/strong-moose-jam.md @@ -0,0 +1,7 @@ +--- +'@astrojs/starlight': minor +--- + +Updates `astro-expressive-code` dependency to the latest minor release (0.35) and exposes a new `@astrojs/starlight/expressive-code/hast` module for users who need to use Expressive Code’s version of `hast`. + +This includes a potentially breaking change if you use custom Expressive Code plugins. See the [Expressive Code release notes](https://expressive-code.com/releases/#0340) for full details. diff --git a/.changeset/sweet-vans-carry.md b/.changeset/sweet-vans-carry.md new file mode 100644 index 0000000000..3005a1dcf2 --- /dev/null +++ b/.changeset/sweet-vans-carry.md @@ -0,0 +1,5 @@ +--- +'@astrojs/starlight': patch +--- + +Refactors `` custom element logic to improve performance diff --git a/.changeset/swift-files-wave.md b/.changeset/swift-files-wave.md new file mode 100644 index 0000000000..694a0b6de5 --- /dev/null +++ b/.changeset/swift-files-wave.md @@ -0,0 +1,5 @@ +--- +'@astrojs/starlight': patch +--- + +Fixes responding to system color scheme changes when theme is `auto` diff --git a/.changeset/tiny-walls-carry.md b/.changeset/tiny-walls-carry.md new file mode 100644 index 0000000000..f49a2e8c17 --- /dev/null +++ b/.changeset/tiny-walls-carry.md @@ -0,0 +1,5 @@ +--- +"@astrojs/starlight": patch +--- + +Updates the Farsi UI translations diff --git a/.changeset/wet-lemons-drum.md b/.changeset/wet-lemons-drum.md deleted file mode 100644 index 79a013a976..0000000000 --- a/.changeset/wet-lemons-drum.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/starlight': patch ---- - -Fixes translation issues with Expressive Code when using a default language other than English diff --git a/.github/workflows/file-icons.yml b/.github/workflows/file-icons.yml new file mode 100644 index 0000000000..56148a8483 --- /dev/null +++ b/.github/workflows/file-icons.yml @@ -0,0 +1,45 @@ +name: File icons generator + +on: + schedule: + - cron: '0 0 * * 0' + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + icons: + name: Generate file icons + if: github.repository_owner == 'withastro' + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Setup PNPM + uses: pnpm/action-setup@v3 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 18 + cache: 'pnpm' + + - name: Install Dependencies + run: pnpm i + + - name: Run file icons generator + run: pnpm build + working-directory: packages/file-icons-generator + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + branch: ci/file-icons + token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }} + commit-message: 'ci: update file icons' + title: 'ci: update file icons' + body: | + This PR is auto-generated by a GitHub action to update the file icons and file tree definitions available in Starlight. diff --git a/.github/workflows/lunaria.yml b/.github/workflows/lunaria.yml new file mode 100644 index 0000000000..1b0b372b47 --- /dev/null +++ b/.github/workflows/lunaria.yml @@ -0,0 +1,46 @@ +name: Lunaria + +on: + # Trigger the workflow every time a pull request is opened or synchronized at the target `main` branch + pull_request_target: + types: [opened, synchronize] + branches: [main] + paths: + - 'docs/**' + +# Allow this job to clone the repository and comment on the pull request +permissions: + contents: read + pull-requests: write + +jobs: + lunaria-overview: + name: Generate Lunaria Overview + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + # Necessary for Lunaria to work properly + # Makes the action clone the entire git history + fetch-depth: 0 + + - name: Setup PNPM + uses: pnpm/action-setup@v3 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + + - name: Install dependencies + run: pnpm install + shell: bash + + - name: Generate Lunaria Overview + uses: yanthomasdev/lunaria-action@f60cb4c257e95ab41fc44356c4a852fe614e3bb4 + with: + token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }} + working-directory: docs diff --git a/docs/lunaria.config.json b/docs/lunaria.config.json index 8f8d9ecb47..029acfc037 100644 --- a/docs/lunaria.config.json +++ b/docs/lunaria.config.json @@ -73,7 +73,8 @@ "files": [ { "location": "src/content/docs/**/*.{md,mdx}", - "pattern": "src/content/docs/@lang/@path" + "pattern": "src/content/docs/@lang/@path", + "type": "universal" } ], "dashboard": { diff --git a/docs/package.json b/docs/package.json index 4fb44099f8..2fc29fa1e9 100644 --- a/docs/package.json +++ b/docs/package.json @@ -16,7 +16,7 @@ "dependencies": { "@astro-community/astro-embed-youtube": "^0.4.4", "@astrojs/starlight": "workspace:*", - "@lunariajs/core": "^0.0.25", + "@lunariajs/core": "^0.0.32", "@types/culori": "^2.0.0", "astro": "^4.3.5", "culori": "^3.2.0", diff --git a/docs/src/assets/showcase/truecharts.org.png b/docs/src/assets/showcase/truecharts.org.png new file mode 100644 index 0000000000..e75c2d99ed Binary files /dev/null and b/docs/src/assets/showcase/truecharts.org.png differ diff --git a/docs/src/components/showcase-sites.astro b/docs/src/components/showcase-sites.astro index 2a04c52e29..224a35206b 100644 --- a/docs/src/components/showcase-sites.astro +++ b/docs/src/components/showcase-sites.astro @@ -126,4 +126,5 @@ import FluidGrid from './fluid-grid.astro'; href="https://docs.fontawesome.com/" thumbnail="docs.fontawesome.com.png" /> + diff --git a/docs/src/components/sidebar-preview.astro b/docs/src/components/sidebar-preview.astro index bd10705d16..f392972a00 100644 --- a/docs/src/components/sidebar-preview.astro +++ b/docs/src/components/sidebar-preview.astro @@ -17,7 +17,10 @@ function makeEntries(items: SidebarConfig): SidebarEntry[] { return { type: 'link', label: item.label, - href: item.link, + // Empty hrefs are used to represent internal links that do not exist in the Starlight + // docs. Using a non-existing anchor link like `#_` will not trigger a page reload or any + // scrolling. + href: item.link.length > 0 ? item.link : '#_', isCurrent: false, badge: item.badge, attrs: item.attrs ?? {}, diff --git a/docs/src/content/docs/es/guides/sidebar.mdx b/docs/src/content/docs/es/guides/sidebar.mdx index ef52127830..72fb58c0e1 100644 --- a/docs/src/content/docs/es/guides/sidebar.mdx +++ b/docs/src/content/docs/es/guides/sidebar.mdx @@ -19,11 +19,11 @@ Por ejemplo, dada la siguiente estructura de archivos: - src/ - content/ - docs/ - - guides/ - - components.md - - i18n.md - - reference/ - - configuration.md + - constellations/ + - andromeda.md + - orion.md + - stars/ + - betelgeuse.md @@ -32,20 +32,15 @@ La siguiente barra lateral se generará automáticamente: @@ -65,10 +60,10 @@ Agrega un enlace a una página interna o externa usando un objeto con las propie ```js "label:" "link:" 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/' }, + // Un enlace a la página de la luna Ganímedes. + { label: 'Ganímedes', link: '/moons/ganymede/' }, + // Un enlace externo al sitio web de la NASA. + { label: 'NASA', link: 'https://www.nasa.gov/' }, ], }); ``` @@ -77,8 +72,8 @@ La configuración anterior genera la siguiente barra lateral: @@ -94,19 +89,19 @@ Agrega enlaces o subgrupos al arreglo `items`. ```js /^\s*(label:|items:)/ starlight({ sidebar: [ - // Un grupo de enlaces etiquetados como "Guides" + // Un grupo de enlaces etiquetado "Constelaciones". { - label: 'Guías', + label: 'Constelaciones', items: [ - { label: 'Componentes', link: '/guides/components/' }, - { label: 'Internacionalización (i18n)', link: '/guides/i18n/' }, - // Un grupo anidado de enlaces. + { label: 'Carina', link: '/constellations/carina/' }, + { label: 'Centaurus', link: '/constellations/centaurus/' }, + // Un grupo anidado de enlaces para constelaciones estacionales. { - label: 'Estilando', + label: 'Estacional', items: [ - { label: 'CSS', link: '/guides/css-and-tailwind/' }, - { label: 'Tailwind', link: '/guides/css-and-tailwind/' }, - { label: 'Shiki', link: '/guides/css-and-tailwind/' }, + { label: 'Andrómeda', link: '/constellations/andromeda/' }, + { label: 'Orión', link: '/constellations/orion/' }, + { label: 'Osa Menor', link: '/constellations/ursa-minor/' }, ], }, ], @@ -120,16 +115,16 @@ La configuración anterior genera la siguiente barra lateral: @@ -178,18 +173,13 @@ La siguiente barra lateral se generará automáticamente: Este comportamiento puede remplazarse definiendo la propiedad `autogenerate.collapsed`. @@ -519,11 +505,11 @@ Este comportamiento puede remplazarse definiendo la propiedad `autogenerate.coll starlight({ sidebar: [ { - label: 'Guías', - // No colapsa el grupo "Guides" pero colapsa sus + label: 'Constelaciones', + // No colapsa el grupo "Constelattions" pero colapsa sus // subgrupos autogenerados. collapsed: false, - autogenerate: { directory: 'guides', collapsed: true }, + autogenerate: { directory: 'constellations', collapsed: true }, }, ], }); @@ -534,19 +520,14 @@ La configuración anterior genera la siguiente barra lateral: + diff --git a/docs/src/content/docs/es/resources/showcase.mdx b/docs/src/content/docs/es/resources/showcase.mdx index 21902d3075..979d8be196 100644 --- a/docs/src/content/docs/es/resources/showcase.mdx +++ b/docs/src/content/docs/es/resources/showcase.mdx @@ -7,7 +7,7 @@ sidebar: :::tip[¡Agrega el tuyo!] ¿Has construido un sitio de Starlight o una herramienta para Starlight? -¡Abre una PR agregando un enlace a esta página! +¡[Abre una PR](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md#showcase) agregando un enlace a esta página! ::: ## Sitios diff --git a/docs/src/content/docs/fr/guides/sidebar.mdx b/docs/src/content/docs/fr/guides/sidebar.mdx index 5f8e81a276..b30837eb19 100644 --- a/docs/src/content/docs/fr/guides/sidebar.mdx +++ b/docs/src/content/docs/fr/guides/sidebar.mdx @@ -19,11 +19,11 @@ Par exemple, pour la structure de fichiers suivante : - src/ - content/ - docs/ - - guides/ - - components.md - - i18n.md - - reference/ - - configuration.md + - constellations/ + - andromede.md + - orion.md + - etoiles/ + - betelgeuse.md @@ -32,20 +32,15 @@ La barre latérale suivante sera automatiquement générée : @@ -65,10 +60,10 @@ Ajoutez un lien vers une page interne ou externe en utilisant un objet avec les ```js "label:" "link:" starlight({ sidebar: [ - // Un lien vers le guide CSS et mise en forme. - { label: 'CSS et mise en forme', link: '/fr/guides/css-and-tailwind/' }, - // Un lien externe vers le site Astro. - { label: 'Astro', link: 'https://astro.build/' }, + // Un lien vers la page de la lune Ganymède. + { label: 'Ganymède', link: '/lunes/ganymede/' }, + // Un lien externe vers le site de la NASA. + { label: 'NASA', link: 'https://www.nasa.gov/' }, ], }); ``` @@ -77,8 +72,8 @@ La configuration ci-dessus génère la barre latérale suivante : @@ -94,19 +89,19 @@ Ajoutez des liens ou des sous-groupes au tableau `items`. ```js /^\s*(label:|items:)/ starlight({ sidebar: [ - // Un groupe de liens avec le label "Guides". + // Un groupe de liens avec le label "Constellations". { - label: 'Guides', + label: 'Constellations', items: [ - { label: 'Composants', link: '/fr/guides/components/' }, - { label: 'Internationalisation (i18n)', link: '/fr/guides/i18n/' }, - // Un groupe de liens imbriqué. + { label: 'Carène', link: '/constellations/carene/' }, + { label: 'Centaure', link: '/constellations/centaure/' }, + // Un groupe de liens imbriqué pour les constellations saisonnières. { - label: 'Mise en forme', + label: 'Saisonnières', items: [ - { label: 'CSS', link: '/fr/guides/css-and-tailwind/' }, - { label: 'Tailwind', link: '/fr/guides/css-and-tailwind/' }, - { label: 'Shiki', link: '/fr/guides/css-and-tailwind/' }, + { label: 'Andromède', link: '/constellations/andromede/' }, + { label: 'Orion', link: '/constellations/orion/' }, + { label: 'Petite Ourse', link: '/constellations/petite-ourse/' }, ], }, ], @@ -120,16 +115,16 @@ La configuration ci-dessus génère la barre latérale suivante : @@ -178,18 +173,13 @@ La barre latérale suivante sera générée : - + ## Contenu vidéo @@ -123,5 +127,12 @@ import YouTubeGrid from '~/components/youtube-grid.astro'; description: "Créez un nouveau site Starlight prêt à l'emploi en environ 5 minutes", }, + { + href: 'https://www.youtube.com/watch?v=12o7WxjAxjM', + title: + 'Inclure une documentation Starlight dans un projet Next.js avec des proxys', + description: + "Configurer un projet Starlight dans un sous-répertoire au sein d'un site Next.js", + }, ]} /> diff --git a/docs/src/content/docs/guides/sidebar.mdx b/docs/src/content/docs/guides/sidebar.mdx index 726e9f9a27..bf9d360564 100644 --- a/docs/src/content/docs/guides/sidebar.mdx +++ b/docs/src/content/docs/guides/sidebar.mdx @@ -19,11 +19,11 @@ For example, given the following file structure: - src/ - content/ - docs/ - - guides/ - - components.md - - i18n.md - - reference/ - - configuration.md + - constellations/ + - andromeda.md + - orion.md + - stars/ + - betelgeuse.md @@ -32,17 +32,15 @@ The following sidebar will be automatically generated: @@ -62,10 +60,10 @@ Add a link to an internal or external page using an object with `label` and `lin ```js "label:" "link:" 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/' }, + // A link to the Ganymede moon page. + { label: 'Ganymede', link: '/moons/ganymede/' }, + // An external link to the NASA website. + { label: 'NASA', link: 'https://www.nasa.gov/' }, ], }); ``` @@ -74,8 +72,8 @@ The configuration above generates the following sidebar: @@ -91,19 +89,19 @@ Add links or subgroups to the `items` array. ```js /^\s*(label:|items:)/ starlight({ sidebar: [ - // A group of links labelled "Guides". + // A group of links labelled "Constellations". { - label: 'Guides', + label: 'Constellations', items: [ - { label: 'Components', link: '/guides/components/' }, - { label: 'Internationalization (i18n)', link: '/guides/i18n/' }, - // A nested group of links. + { label: 'Carina', link: '/constellations/carina/' }, + { label: 'Centaurus', link: '/constellations/centaurus/' }, + // A nested group of links for seasonal constellations. { - label: 'Styling', + label: 'Seasonal', items: [ - { label: 'CSS', link: '/guides/css-and-tailwind/' }, - { label: 'Tailwind', link: '/guides/css-and-tailwind/' }, - { label: 'Shiki', link: '/guides/css-and-tailwind/' }, + { label: 'Andromeda', link: '/constellations/andromeda/' }, + { label: 'Orion', link: '/constellations/orion/' }, + { label: 'Ursa Minor', link: '/constellations/ursa-minor/' }, ], }, ], @@ -117,16 +115,16 @@ The configuration above generates the following sidebar: @@ -175,15 +173,13 @@ The following sidebar will be generated: ` और `` अवयवों का उपयोग करके एक टैब्ड इंटरफ़ेस प्रदर्शित कर सकते हैं। प्रत्येक `` में उपयोगकर्ताओं को प्रदर्शित करने के लिए एक `label` होना चाहिए। +लेबल के आगे [Starlight के अंतर्निर्मित आइकन](#सभी-आइकन) में से एक को शामिल करने के लिए वैकल्पिक `icon` विशेषता का उपयोग करें। ```mdx # src/content/docs/example.mdx @@ -66,16 +67,24 @@ import { Tabs, TabItem } from '@astrojs/starlight/components'; import { Tabs, TabItem } from '@astrojs/starlight/components'; - Sirius, Vega, Betelgeuse - Io, Europa, Ganymede + + Sirius, Vega, Betelgeuse + + + Io, Europa, Ganymede + ``` उपरोक्त कोड पेज पर निम्नलिखित टैब उत्पन्न करता है: - Sirius, Vega, Betelgeuse - Io, Europa, Ganymede + + Sirius, Vega, Betelgeuse + + + Io, Europa, Ganymede + ### कार्ड @@ -224,33 +233,6 @@ import { Aside } from '@astrojs/starlight/components'; Starlight `