Skip to content

Commit 968746f

Browse files
authored
Merge branch 'main' into patch-1
2 parents 2a4e29f + dc1433d commit 968746f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+855
-215
lines changed

.changeset/kind-boats-train.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@astrojs/starlight': patch
3+
---
4+
5+
Add Slack social link icon

.changeset/polite-colts-turn.md

-5
This file was deleted.

.changeset/quiet-humans-lie.md

-5
This file was deleted.

.changeset/thick-boxes-fail.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@astrojs/starlight": minor
3+
---
4+
5+
Add i18n support for default aside labels

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ pnpm-debug.log*
1616

1717
# Vitest
1818
__coverage__/
19+
20+
# Vercel output
21+
.vercel

.prettierignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@
1010
.changeset
1111

1212
# Files
13-
pnpm-lock.yaml
13+
pnpm-lock.yaml
14+
15+
# Test snapshots
16+
**/__tests__/**/snapshots

docs/astro.config.mjs

+7-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ export const locales = {
1616
ru: { label: 'Русский', lang: 'ru' },
1717
};
1818

19-
const site = 'https://starlight.astro.build/';
19+
/* https://vercel.com/docs/projects/environment-variables/system-environment-variables#system-environment-variables */
20+
const VERCEL_PREVIEW_SITE =
21+
process.env.VERCEL_ENV !== 'production' &&
22+
process.env.VERCEL_URL &&
23+
`https://${process.env.VERCEL_URL}`;
24+
25+
const site = VERCEL_PREVIEW_SITE || 'https://starlight.astro.build/';
2026

2127
export default defineConfig({
2228
site,
@@ -175,7 +181,6 @@ export default defineConfig({
175181
autogenerate: { directory: 'reference' },
176182
},
177183
],
178-
lastUpdated: true,
179184
}),
180185
],
181186
});

docs/public/_headers

-4
This file was deleted.

docs/public/_redirects

-3
This file was deleted.
Loading

docs/src/components/showcase-sites.astro

+5
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,9 @@ import FluidGrid from './fluid-grid.astro';
7070
href="https://react-awesome-reveal.morello.dev/"
7171
thumbnail="react-awesome-reveal.morello.dev.png"
7272
/>
73+
<Card
74+
title="Ethereum Follow Protocol"
75+
href="https://docs.ethfollow.xyz/"
76+
thumbnail="docs.ethfollow.xyz.png"
77+
/>
7378
</FluidGrid>

docs/src/content/docs/de/guides/authoring-content.md

+4
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,7 @@ Lange, einzeilige Codeblöcke sollten nicht umgebrochen werden. Sie sollten hori
207207
## Andere allgemeine Markdown-Funktionen
208208

209209
Starlight unterstützt alle anderen Markdown-Autorensyntaxen, wie Listen und Tabellen. Einen schnellen Überblick über alle Markdown-Syntaxelemente findest du im [Markdown Cheat Sheet von The Markdown Guide](https://www.markdownguide.org/cheat-sheet/).
210+
211+
## Erweiterte Markdown- und MDX-Konfiguration
212+
213+
Starlight verwendet Astros Markdown- und MDX-Renderer, der auf remark und rehype aufbaut. Du kannst eine Unterstützung für eigene Syntax und Verhalten hinzufügen, indem du `remarkPlugins` oder `rehypePlugins` in deiner Astro-Konfigurationsdatei hinzufügst. Weitere Informationen findest du unter ["Markdown konfigurieren"] (https://docs.astro.build/de/guides/markdown-content/#markdown-konfigurieren) in der Astro-Dokumentation.

docs/src/content/docs/de/guides/i18n.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Wenn für eine Sprache noch keine Übersetzung verfügbar ist, zeigt Starlight d
143143

144144
Starlight bietet nicht nur übersetzte Inhaltsdateien, sondern auch die Möglichkeit, die Standard-Benutzeroberfläche zu übersetzen (z.B. die Überschrift "Auf dieser Seite" im Inhaltsverzeichnis), so dass deine Leser deine Website vollständig in der ausgewählten Sprache erleben können.
145145

146-
Englisch, Tschechisch, Französisch, Deutsch, Italienisch, Japanisch, Portugiesisch, Niederländisch, Dänisch, Spanisch, Türkisch, Arabisch, Norwegisch, Farsi, Hebräisch, Chinesisch (vereinfacht), Koreanisch, Indonesisch, Russisch, Schwedisch, Ukrainisch und Vietnamesisch werden standardmäßig übersetzt, und wir freuen uns über [Beiträge zur Aufnahme weiterer Standardsprachen](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md).
146+
Englisch, Tschechisch, Französisch, Deutsch, Italienisch, Japanisch, Portugiesisch, Niederländisch, Dänisch, Spanisch, Türkisch, Arabisch, Norwegisch, Farsi, Hebräisch, Chinesisch (vereinfacht), Koreanisch, Indonesisch, Russisch, Schwedisch, Ukrainisch, Vietnamesisch und Galizisch werden standardmäßig übersetzt, und wir freuen uns über [Beiträge zur Aufnahme weiterer Standardsprachen](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md).
147147

148148
Du kannst Übersetzungen für zusätzliche Sprachen, die du unterstützt, über die `i18n` Datensammlung zur Verfügung stellen - oder unsere Standardbezeichnungen überschreiben.
149149

docs/src/content/docs/de/reference/configuration.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ sidebar: [
181181
type SidebarItem = {
182182
label: string;
183183
translations?: Record<string, string>;
184+
badge?: string | BadgeConfig;
184185
} & (
185186
| {
186187
link: string;
187-
badge?: string | BadgeConfig;
188188
attrs?: Record<string, string | number | boolean | undefined>;
189189
}
190190
| { items: SidebarItem[]; collapsed?: boolean }

docs/src/content/docs/es/guides/i18n.mdx

+5-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,11 @@ Si no hay una traducción disponible para un idioma, Starlight mostrará a los l
140140

141141
## Traduce la UI de Starlight
142142

143-
Starlight proporciona de forma predeterminada traducciones para los textos utilizados en la UI al inglés, checo, francés, alemán, italiano, japonés, holandés, portugués, danés, español, turco, árabe, noruego, farsi, hebreo, chino simplificado, coreano, indonesio, ruso, sueco, ucraniano y vietnamita. También damos la bienvenida a [contribuciones para agregar más idiomas predeterminados](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md).
143+
Además de alojar archivos de contenido traducidos, Starlight te permite traducir las etiquetas de UI predeterminadas (p. ej. el encabezado "En esta página" en la tabla de contenidos) para que tus lectores puedan experimentar tu sitio completamente en el idioma seleccionado.
144+
145+
Inglés, checo, francés, alemán, italiano, japonés, portugués, holandés, danés, español, turco, árabe, noruego, farsi, hebreo, chino simplificado, coreano, indonesio, ruso, sueco, ucraniano, vietnamita y gallego se proporcionan de forma predeterminada, y damos la bienvenida a [contribuciones para agregar más idiomas predeterminados](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md).
146+
147+
Puedes proprocionar traducciones para idiomas adicionales, o editar nuestras etiquetas predeterminadas, a través de la colección de datos `i18n`.
144148

145149
1. Configura la colección de datos `i18n` en `src/content/config.ts` si aún no está configurada:
146150

docs/src/content/docs/es/reference/frontmatter.md

+32-8
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,44 @@ hero:
111111
---
112112
```
113113

114+
Puedes mostrar diferentes versiones de la imagen hero en los modos claro y oscuro.
115+
116+
```md
117+
---
118+
hero:
119+
image:
120+
alt: Un logotipo brillante, de colores brillantes
121+
dark: ../../assets/logo-dark.png
122+
light: ../../assets/logo-light.png
123+
---
124+
```
125+
114126
#### `HeroConfig`
115127

116128
```ts
117129
interface HeroConfig {
118130
title?: string;
119131
tagline?: string;
120-
image?: {
121-
alt?: string;
122-
// Ruta relativa a una imagen en tu repositorio.
123-
file?: string;
124-
// HTML crudo para usar en el espacio de la imagen.
125-
// Podría ser una etiqueta `<img>` personalizada o un `<svg>` en línea.
126-
html?: string;
127-
};
132+
image?:
133+
| {
134+
// Ruta relativa a una imagen en tu repositorio.
135+
file: string;
136+
// Texto alternativo para hacer que la imagen sea accesible a la tecnología de asistencia
137+
alt?: string;
138+
}
139+
| {
140+
// Ruta relativa a una imagen en tu repositorio para usar en el modo oscuro.
141+
dark: string;
142+
// Ruta relativa a una imagen en tu repositorio para usar en el modo claro.
143+
light: string;
144+
// Texto alternativo para hacer que la imagen sea accesible a la tecnología de asistencia
145+
alt?: string;
146+
}
147+
| {
148+
// HTML crudo para usar en el espacio de la imagen.
149+
// Podría ser una etiqueta `<img>` personalizada o un `<svg>` en línea.
150+
html: string;
151+
};
128152
actions?: Array<{
129153
text: string;
130154
link: string;

docs/src/content/docs/es/reference/overrides.md

+2
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ La implementación predeterminada muestra un título grande, un lema y enlaces d
344344
Componente renderizado alrededor del contenido principal de cada página.
345345
La implementación predeterminada configura estilos básicos para aplicar al contenido de Markdown.
346346

347+
Los estilos de contenido Markdown también están expuestos en `@astrojs/starlight/style/markdown.css` y están limitados al ámbito de la clase CSS `.sl-markdown-content`.
348+
347349
---
348350

349351
### Pie de página

docs/src/content/docs/ko/reference/overrides.md

+2
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ Starlight의 페이지 사이드바는 현재 페이지의 하위 제목을 간
337337
각 페이지의 메인 콘텐츠 주위에 렌더링되는 컴포넌트입니다.
338338
기본적으로 마크다운 콘텐츠에 적용할 기본 스타일을 설정합니다.
339339

340+
Markdown 콘텐츠 스타일은 `@astrojs/starlight/style/markdown.css`에도 노출되며 `.sl-markdown-content` CSS 클래스로 범위가 지정됩니다.
341+
340342
---
341343

342344
### 바닥글

docs/src/content/docs/pt-br/reference/configuration.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ sidebar: [
183183
type SidebarItem = {
184184
label: string;
185185
translations?: Record<string, string>;
186+
badge?: string | BadgeConfig;
186187
} & (
187188
| {
188189
link: string;
189-
badge?: string | BadgeConfig;
190190
attrs?: Record<string, string | number | boolean | undefined>;
191191
}
192192
| { items: SidebarItem[]; collapsed?: boolean }

docs/src/content/docs/pt-br/reference/frontmatter.md

+32-8
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,44 @@ hero:
111111
---
112112
```
113113

114+
Você pode exibir diferentes versões da imagem hero no modo claro e escuro.
115+
116+
```md
117+
---
118+
hero:
119+
image:
120+
alt: Um logo brilhante e colorido
121+
dark: ../../assets/logo-escuro.png
122+
light: ../../assets/logo-claro.png
123+
---
124+
```
125+
114126
#### `HeroConfig`
115127

116128
```ts
117129
interface HeroConfig {
118130
title?: string;
119131
tagline?: string;
120-
image?: {
121-
alt?: string;
122-
// Caminho relativo a uma imagem no seu repositório.
123-
file?: string;
124-
// HTML bruto para utilizar no slot de imagem.
125-
// Pode ser uma tag `<img>` customizada ou um `<svg>` inline.
126-
html?: string;
127-
};
132+
image?:
133+
| {
134+
// Caminho relativo de uma imagem no seu repositório.
135+
file: string;
136+
// Texto alternativo para tornar a imagem acessível à tecnologia assistiva
137+
alt?: string;
138+
}
139+
| {
140+
// Caminho relativo de uma imagem em seu repositório para ser usada no modo escuro.
141+
dark: string;
142+
// Caminho relativo de uma imagem em seu repositório para ser usada no modo claro.
143+
light: string;
144+
// Texto alternativo para tornar a imagem acessível à tecnologia assistiva
145+
alt?: string;
146+
}
147+
| {
148+
// HTML bruto para utilizar no slot de imagem.
149+
// Pode ser uma tag `<img>` personalizada ou um `<svg>` inline.
150+
html: string;
151+
};
128152
actions?: Array<{
129153
text: string;
130154
link: string;

docs/src/content/docs/reference/overrides.md

+2
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ The default implementation shows a large title, tagline, and call-to-action link
342342
Component rendered around each page’s main content.
343343
The default implementation sets up basic styles to apply to Markdown content.
344344

345+
The Markdown content styles are also exposed in `@astrojs/starlight/style/markdown.css` and scoped to the `.sl-markdown-content` CSS class.
346+
345347
---
346348

347349
### Footer

docs/vercel.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://openapi.vercel.sh/vercel.json",
3+
4+
"routes": [
5+
{
6+
"src": "^/_astro/(.*)$",
7+
"headers": { "cache-control": "public, max-age=31536000, immutable" },
8+
"continue": true
9+
},
10+
11+
{ "src": "/(ph$|ph/)(.*)", "dest": "https://astro-houston-ph.pages.dev/ph/$2" },
12+
13+
{ "src": "(.*)/([^./]+)$", "dest": "$1/$2/", "status": 301 },
14+
{ "src": "(.*)/index.html$", "dest": "$1/", "status": 301 },
15+
16+
{ "handle": "filesystem" },
17+
18+
{ "src": "/zh/(.*)", "dest": "/zh-cn/$1", "status": 301 },
19+
20+
{ "src": "/(?<lang>[^/]*)/(.*)", "dest": "/$lang/404/", "status": 404 }
21+
]
22+
}

examples/basics/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"astro": "astro"
1212
},
1313
"dependencies": {
14-
"@astrojs/starlight": "^0.12.0",
14+
"@astrojs/starlight": "^0.12.1",
1515
"astro": "^3.2.3",
1616
"sharp": "^0.32.5"
1717
}

examples/tailwind/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"astro": "astro"
1212
},
1313
"dependencies": {
14-
"@astrojs/starlight": "^0.12.0",
14+
"@astrojs/starlight": "^0.12.1",
1515
"@astrojs/starlight-tailwind": "^2.0.1",
1616
"@astrojs/tailwind": "^5.0.0",
1717
"astro": "^3.2.3",

packages/starlight/CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# @astrojs/starlight
22

3+
## 0.12.1
4+
5+
### Patch Changes
6+
7+
- [#1069](https://github.com/withastro/starlight/pull/1069) [`b86f360`](https://github.com/withastro/starlight/commit/b86f3608f03be9455ec1d5ba11820c9bf601ad1e) Thanks [@Genteure](https://github.com/Genteure)! - Fix sidebar highlighting and navigation buttons for pages with path containing non-ASCII characters
8+
9+
- [#1025](https://github.com/withastro/starlight/pull/1025) [`0d1e75e`](https://github.com/withastro/starlight/commit/0d1e75e17269ddac3eb15b7dfb4480da1bb01c6c) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Internal: fix import issue in translation string loading mechanism
10+
11+
- [#1044](https://github.com/withastro/starlight/pull/1044) [`a5a9754`](https://github.com/withastro/starlight/commit/a5a9754f111b97abfd277d99759e9857aa0fb22b) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fix last updated dates for pages displaying fallback content
12+
13+
- [#1049](https://github.com/withastro/starlight/pull/1049) [`c27495d`](https://github.com/withastro/starlight/commit/c27495da61f9376236519ed3f08a169f245a189c) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Expose Markdown content styles in `@astrojs/starlight/style/markdown.css`
14+
315
## 0.12.0
416

517
### Minor Changes
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { describe, expect, test } from 'vitest';
2+
import { getSitemapConfig, starlightSitemap } from '../../integrations/sitemap';
3+
import type { StarlightConfig } from '../../types';
4+
import { StarlightConfigSchema, type StarlightUserConfig } from '../../utils/user-config';
5+
6+
describe('starlightSitemap', () => {
7+
test('returns @astrojs/sitemap integration', () => {
8+
const integration = starlightSitemap({} as StarlightConfig);
9+
expect(integration.name).toBe('@astrojs/sitemap');
10+
});
11+
});
12+
13+
describe('getSitemapConfig', () => {
14+
test('configures i18n config', () => {
15+
const config = getSitemapConfig(
16+
StarlightConfigSchema.parse({
17+
title: 'i18n test',
18+
locales: { root: { lang: 'en', label: 'English' }, fr: { label: 'French' } },
19+
} satisfies StarlightUserConfig)
20+
);
21+
expect(config).toMatchInlineSnapshot(`
22+
{
23+
"i18n": {
24+
"defaultLocale": "root",
25+
"locales": {
26+
"fr": "fr",
27+
"root": "en",
28+
},
29+
},
30+
}
31+
`);
32+
});
33+
34+
test('no config for monolingual sites', () => {
35+
const config = getSitemapConfig(
36+
StarlightConfigSchema.parse({ title: 'i18n test' } satisfies StarlightUserConfig)
37+
);
38+
expect(config).toMatchInlineSnapshot('{}');
39+
});
40+
});

0 commit comments

Comments
 (0)