Skip to content

Commit

Permalink
Merge branch 'main' into hd-file-tree
Browse files Browse the repository at this point in the history
  • Loading branch information
delucis committed Mar 1, 2024
2 parents d9dfc9f + 5f99a71 commit 9e881ec
Show file tree
Hide file tree
Showing 23 changed files with 506 additions and 83 deletions.
5 changes: 5 additions & 0 deletions .changeset/curly-taxis-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/starlight': minor
---

Adds support for optionally setting an icon on a `<TabItem>` component to make it easier to visually distinguish between tabs.
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
name: Run unit tests
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
Expand All @@ -35,13 +35,13 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
Expand All @@ -63,9 +63,9 @@ jobs:
name: Docs site builds on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
Expand All @@ -79,13 +79,13 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code using Git
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
# Needs access to push to main
token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'pnpm'
- run: pnpm i
- name: Format with Prettier
run: pnpm format
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: '[ci] format'
branch: ${{ github.head_ref }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup PNPM
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'pnpm'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v3
- run: pnpm i
- run: 'pnpm build:examples'
- run: pnpm size
Expand All @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v3
- name: Run size-limit
uses: andresz1/size-limit-action@dd31dce7dcc72a041fd3e49abf0502b13fc4ce05
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/welcome-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Welcome First-Time Contributors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: zephyrproject-rtos/action-first-interaction@7e6446f8439d8b4399169880c36a3a12b5747699
with:
repo-token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
Expand Down
4 changes: 4 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export default defineConfig({
id: 'Mulai dari sini',
'zh-CN': '从这里开始',
'pt-BR': 'Comece Aqui',
'pt-PT': 'Comece Aqui',
ko: '여기서부터',
tr: 'Buradan Başlayın',
ru: 'Начать отсюда',
Expand All @@ -98,6 +99,7 @@ export default defineConfig({
id: 'Memulai',
'zh-CN': '开始使用',
'pt-BR': 'Introdução',
'pt-PT': 'Introdução',
ko: '시작하기',
tr: 'Başlarken',
ru: 'Введение',
Expand All @@ -117,6 +119,7 @@ export default defineConfig({
id: 'Instalasi Manual',
'zh-CN': '手动配置',
'pt-BR': 'Instalação Manual',
'pt-PT': 'Instalação Manual',
ko: '수동으로 설정하기',
tr: 'Elle Kurulum',
ru: 'Установка вручную',
Expand All @@ -136,6 +139,7 @@ export default defineConfig({
id: 'Dampak terhadap lingkungan',
'zh-CN': '环境影响',
'pt-BR': 'Impacto Ambiental',
'pt-PT': 'Impacto Ambiental',
ko: '환경적 영향',
tr: 'Çevre Etkisi',
ru: 'Влияние на окружающую среду',
Expand Down
Binary file added docs/src/assets/showcase/docs.flojoy.ai.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/showcase/onerepo.tools.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/src/components/showcase-sites.astro
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,6 @@ import FluidGrid from './fluid-grid.astro';
href="https://astro-ghostcms.xyz/"
thumbnail="astro-ghostcms.xyz.png"
/>
<Card title="oneRepo" href="https://onerepo.tools" thumbnail="onerepo.tools.png" />
<Card title="Flojoy" href="https://docs.flojoy.ai" thumbnail="docs.flojoy.ai.png" />
</FluidGrid>
55 changes: 55 additions & 0 deletions docs/src/content/docs/es/guides/components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,61 @@ import { LinkCard } from '@astrojs/starlight/components';
<LinkCard title="Componentes" href="/es/guides/components/" />
</CardGrid>

### Apartados

Los apartados son útiles para mostrar información secundaria junto al contenido principal de una página.

Un `<Aside>` puede tener un `type` opcional de `note` (el valor predeterminado), `tip`, `caution` o `danger`. Establecer un atributo `title` anula el título predeterminado del apartado.

````mdx
# src/content/docs/example.mdx

import { Aside } from '@astrojs/starlight/components';

<Aside>Un apartado predeterminado sin un título personalizado.</Aside>

<Aside type="caution" title="Watch out!">
Un apartado de advertencia *con* un título personalizado.
</Aside>

<Aside type="tip">

Otro contenido también es compatible en los apartados.

```js
// Una muestra de código, por ejemplo.
```

</Aside>

<Aside type="danger">No le des tu contraseña a nadie.</Aside>
````

El código anterior genera lo siguiente en la página:

import { Aside } from '@astrojs/starlight/components';

<Aside>Un apartado predeterminado sin un título personalizado.</Aside>

<Aside type="caution" title="Watch out!">
Un apartado de advertencia *con* un título personalizado.
</Aside>

<Aside type="tip">

Otro contenido también es compatible en los apartados.

```js
// Una muestra de código, por ejemplo.
```

</Aside>

<Aside type="danger">No le des tu contraseña a nadie.</Aside>

Starlight también proporciona una sintaxis personalizada para renderizar apartados en Markdown y MDX como una alternativa al componente `<Aside>`.
Consulta la guía [“Creación de contenido en Markdown”](/es/guides/authoring-content/#apartados) para obtener más detalles de la sintaxis personalizada.

### Iconos

import { Icon } from '@astrojs/starlight/components';
Expand Down
17 changes: 13 additions & 4 deletions docs/src/content/docs/guides/components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,32 @@ import { Tabs, TabItem } from '@astrojs/starlight/components';

You can display a tabbed interface using the `<Tabs>` and `<TabItem>` components.
Each `<TabItem>` must have a `label` to display to users.
Use the optional `icon` attribute to include one of [Starlight’s built-in icons](#all-icons) next to the label.

```mdx
# src/content/docs/example.mdx

import { Tabs, TabItem } from '@astrojs/starlight/components';

<Tabs>
<TabItem label="Stars">Sirius, Vega, Betelgeuse</TabItem>
<TabItem label="Moons">Io, Europa, Ganymede</TabItem>
<TabItem label="Stars" icon="star">
Sirius, Vega, Betelgeuse
</TabItem>
<TabItem label="Moons" icon="moon">
Io, Europa, Ganymede
</TabItem>
</Tabs>
```

The code above generates the following tabs on the page:

<Tabs>
<TabItem label="Stars">Sirius, Vega, Betelgeuse</TabItem>
<TabItem label="Moons">Io, Europa, Ganymede</TabItem>
<TabItem label="Stars" icon="star">
Sirius, Vega, Betelgeuse
</TabItem>
<TabItem label="Moons" icon="moon">
Io, Europa, Ganymede
</TabItem>
</Tabs>

### Cards
Expand Down
40 changes: 31 additions & 9 deletions docs/src/content/docs/it/guides/pages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,37 @@ Le seguenti proprietà differiscono dal frontmatter di Markdown:

- La proprietà [`slug`](/it/reference/frontmatter/#slug) non è supportata e viene impostata automaticamente in base all'URL della pagina personalizzata.
- L'opzione [`editUrl`](/it/reference/frontmatter/#editurl) richiede un URL per visualizzare un link di modifica.
- La proprietà [`sidebar`](/it/reference/frontmatter/#sidebar) non è supportata. Nel frontmatter di Markdown, questa opzione consente la personalizzazione dei [gruppi di link generati automaticamente](/it/reference/configuration/#sidebar), che non è applicabile alle pagine che utilizzano il componente `<StarlightPage />`.

{/* ##### `sidebar` */}

{/* **tipo:** `SidebarEntry[] | undefined` */}
{/* **predefinito:** la barra laterale generata in base alla [configurazione globale `sidebar`](/reference/configuration/#sidebar) */}

{/* Fornisce una barra laterale di navigazione personalizzata per questo sito. */}
{/* Se non impostato, la pagina utilizzerà la barra laterale globale predefinita. */}
- La proprietà del frontmatter [`sidebar`](/it/reference/frontmatter/#sidebar) per personalizzare come appare la pagina in [gruppi di link autogenerati](/it/reference/configuration/#sidebar) non è disponibile. Le pagine che utilizzano il componente `<StarlightPage />` non fanno parte di una collezione e non possono essere aggiunte a un gruppo di barra laterale autogenerato.

##### `sidebar`

**tipo:** `SidebarEntry[]`
**predefinito:** la barra laterale generata in base alla [configurazione globale `sidebar`](/it/reference/configuration/#sidebar)

Fornisce una barra laterale di navigazione personalizzata per questa pagina.
Se non impostato, la pagina utilizzerà la barra laterale globale predefinita.

Ad esempio, la pagina seguente sovrascrive la barra laterale predefinita con un link alla homepage e un gruppo di link a diverse costellazioni.
La pagina corrente nella barra laterale è impostata utilizzando la proprietà `isCurrent` e un `badge` opzionale è stato aggiunto a un elemento di link.

```astro {3-13}
<StarlightPage
frontmatter={{ title: 'Orione' }}
sidebar={[
{ label: 'Home', href: '/' },
{
label: 'Costellazioni',
items: [
{ label: 'Andromeda', href: '/andromeda/' },
{ label: 'Orione', href: '/orion/', isCurrent: true },
{ label: 'Orsa Minore', href: '/ursa-minor/', badge: 'Abbozzo' },
],
},
]}
>
Contenuto di esempio.
</StarlightPage>
```

##### `hasSidebar`

Expand Down
35 changes: 25 additions & 10 deletions docs/src/content/docs/it/resources/plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@ Estendi il tuo sito con plugin ufficiali supportati dal team Starlight e plugin
title="starlight-typedoc"
description="Genera pagine Starlight da TypeScript usando TypeDoc."
/>
<LinkCard
href="https://github.com/HiDeoo/starlight-blog"
title="starlight-blog"
description="Aggiungi un blog alla tua documentazione."
/>
<LinkCard
href="https://github.com/HiDeoo/starlight-openapi"
title="starlight-openapi"
description="Crea pagine di documentazione dalle specificazioni OpenAPI/Swagger."
/>
<LinkCard
href="https://github.com/HiDeoo/starlight-obsidian"
title="starlight-obsidian"
description="Pubblica i tuoi vault Obsidian nel tuo sito Starlight."
/>
<LinkCard
href="https://astro-ghostcms.xyz/intro/starlight/install/"
title="starlight-ghostcms"
description="Aggiungi i tuoi post del blog GhostCMS insieme alla tua documentazione Starlight."
/>
</CardGrid>

## Strumenti e integrazioni della community
Expand All @@ -52,16 +72,6 @@ Questi strumenti e integrazioni della community possono essere utilizzati per ag
title="FeelBack"
description="Aggiungi un sistema di feedback utente alle tue pagine di documentazione."
/>
<LinkCard
href="https://github.com/HiDeoo/starlight-blog"
title="starlight-blog"
description="Aggiungi un blog al tuo sito di documentazione."
/>
<LinkCard
href="https://github.com/HiDeoo/starlight-openapi"
title="starlight-openapi"
description="Crea pagine di documentazione da specifiche OpenAPI/Swagger."
/>
<LinkCard
href="https://github.com/val-town/notion-to-astro"
title="notion-to-astro"
Expand All @@ -72,4 +82,9 @@ Questi strumenti e integrazioni della community possono essere utilizzati per ag
title="astro-live-code"
description="Rendi interattivi i blocchi di codice MDX"
/>
<LinkCard
href="https://github.com/HiDeoo/starlight-i18n"
title="starlight-i18n"
description="Estensione di Visual Studio Code che ti aiuta a tradurre le pagine Starlight."
/>
</CardGrid>

0 comments on commit 9e881ec

Please sign in to comment.