Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
delucis authored Nov 17, 2023
2 parents 2a4e29f + dc1433d commit 968746f
Show file tree
Hide file tree
Showing 67 changed files with 855 additions and 215 deletions.
5 changes: 5 additions & 0 deletions .changeset/kind-boats-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/starlight': patch
---

Add Slack social link icon
5 changes: 0 additions & 5 deletions .changeset/polite-colts-turn.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/quiet-humans-lie.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/thick-boxes-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/starlight": minor
---

Add i18n support for default aside labels
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ pnpm-debug.log*

# Vitest
__coverage__/

# Vercel output
.vercel
5 changes: 4 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
.changeset

# Files
pnpm-lock.yaml
pnpm-lock.yaml

# Test snapshots
**/__tests__/**/snapshots
9 changes: 7 additions & 2 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ export const locales = {
ru: { label: 'Русский', lang: 'ru' },
};

const site = 'https://starlight.astro.build/';
/* https://vercel.com/docs/projects/environment-variables/system-environment-variables#system-environment-variables */
const VERCEL_PREVIEW_SITE =
process.env.VERCEL_ENV !== 'production' &&
process.env.VERCEL_URL &&
`https://${process.env.VERCEL_URL}`;

const site = VERCEL_PREVIEW_SITE || 'https://starlight.astro.build/';

export default defineConfig({
site,
Expand Down Expand Up @@ -175,7 +181,6 @@ export default defineConfig({
autogenerate: { directory: 'reference' },
},
],
lastUpdated: true,
}),
],
});
4 changes: 0 additions & 4 deletions docs/public/_headers

This file was deleted.

3 changes: 0 additions & 3 deletions docs/public/_redirects

This file was deleted.

Binary file added docs/src/assets/showcase/docs.ethfollow.xyz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/src/components/showcase-sites.astro
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,9 @@ import FluidGrid from './fluid-grid.astro';
href="https://react-awesome-reveal.morello.dev/"
thumbnail="react-awesome-reveal.morello.dev.png"
/>
<Card
title="Ethereum Follow Protocol"
href="https://docs.ethfollow.xyz/"
thumbnail="docs.ethfollow.xyz.png"
/>
</FluidGrid>
4 changes: 4 additions & 0 deletions docs/src/content/docs/de/guides/authoring-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,7 @@ Lange, einzeilige Codeblöcke sollten nicht umgebrochen werden. Sie sollten hori
## Andere allgemeine Markdown-Funktionen

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/).

## Erweiterte Markdown- und MDX-Konfiguration

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.
2 changes: 1 addition & 1 deletion docs/src/content/docs/de/guides/i18n.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Wenn für eine Sprache noch keine Übersetzung verfügbar ist, zeigt Starlight d

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.

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).
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).

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

Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/de/reference/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ sidebar: [
type SidebarItem = {
label: string;
translations?: Record<string, string>;
badge?: string | BadgeConfig;
} & (
| {
link: string;
badge?: string | BadgeConfig;
attrs?: Record<string, string | number | boolean | undefined>;
}
| { items: SidebarItem[]; collapsed?: boolean }
Expand Down
6 changes: 5 additions & 1 deletion docs/src/content/docs/es/guides/i18n.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ Si no hay una traducción disponible para un idioma, Starlight mostrará a los l

## Traduce la UI de Starlight

Starlight proporciona de forma predeterminada traducciones para los textos utilizados en la UI al inglés, checo, francés, alemán, italiano, japonés, holandés, portugués, danés, español, turco, árabe, noruego, farsi, 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).
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.

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).

Puedes proprocionar traducciones para idiomas adicionales, o editar nuestras etiquetas predeterminadas, a través de la colección de datos `i18n`.

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

Expand Down
40 changes: 32 additions & 8 deletions docs/src/content/docs/es/reference/frontmatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,44 @@ hero:
---
```

Puedes mostrar diferentes versiones de la imagen hero en los modos claro y oscuro.

```md
---
hero:
image:
alt: Un logotipo brillante, de colores brillantes
dark: ../../assets/logo-dark.png
light: ../../assets/logo-light.png
---
```

#### `HeroConfig`

```ts
interface HeroConfig {
title?: string;
tagline?: string;
image?: {
alt?: string;
// Ruta relativa a una imagen en tu repositorio.
file?: string;
// HTML crudo para usar en el espacio de la imagen.
// Podría ser una etiqueta `<img>` personalizada o un `<svg>` en línea.
html?: string;
};
image?:
| {
// Ruta relativa a una imagen en tu repositorio.
file: string;
// Texto alternativo para hacer que la imagen sea accesible a la tecnología de asistencia
alt?: string;
}
| {
// Ruta relativa a una imagen en tu repositorio para usar en el modo oscuro.
dark: string;
// Ruta relativa a una imagen en tu repositorio para usar en el modo claro.
light: string;
// Texto alternativo para hacer que la imagen sea accesible a la tecnología de asistencia
alt?: string;
}
| {
// HTML crudo para usar en el espacio de la imagen.
// Podría ser una etiqueta `<img>` personalizada o un `<svg>` en línea.
html: string;
};
actions?: Array<{
text: string;
link: string;
Expand Down
2 changes: 2 additions & 0 deletions docs/src/content/docs/es/reference/overrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ La implementación predeterminada muestra un título grande, un lema y enlaces d
Componente renderizado alrededor del contenido principal de cada página.
La implementación predeterminada configura estilos básicos para aplicar al contenido de Markdown.

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`.

---

### Pie de página
Expand Down
2 changes: 2 additions & 0 deletions docs/src/content/docs/ko/reference/overrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ Starlight의 페이지 사이드바는 현재 페이지의 하위 제목을 간
각 페이지의 메인 콘텐츠 주위에 렌더링되는 컴포넌트입니다.
기본적으로 마크다운 콘텐츠에 적용할 기본 스타일을 설정합니다.

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

---

### 바닥글
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/pt-br/reference/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ sidebar: [
type SidebarItem = {
label: string;
translations?: Record<string, string>;
badge?: string | BadgeConfig;
} & (
| {
link: string;
badge?: string | BadgeConfig;
attrs?: Record<string, string | number | boolean | undefined>;
}
| { items: SidebarItem[]; collapsed?: boolean }
Expand Down
40 changes: 32 additions & 8 deletions docs/src/content/docs/pt-br/reference/frontmatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,44 @@ hero:
---
```

Você pode exibir diferentes versões da imagem hero no modo claro e escuro.

```md
---
hero:
image:
alt: Um logo brilhante e colorido
dark: ../../assets/logo-escuro.png
light: ../../assets/logo-claro.png
---
```

#### `HeroConfig`

```ts
interface HeroConfig {
title?: string;
tagline?: string;
image?: {
alt?: string;
// Caminho relativo a uma imagem no seu repositório.
file?: string;
// HTML bruto para utilizar no slot de imagem.
// Pode ser uma tag `<img>` customizada ou um `<svg>` inline.
html?: string;
};
image?:
| {
// Caminho relativo de uma imagem no seu repositório.
file: string;
// Texto alternativo para tornar a imagem acessível à tecnologia assistiva
alt?: string;
}
| {
// Caminho relativo de uma imagem em seu repositório para ser usada no modo escuro.
dark: string;
// Caminho relativo de uma imagem em seu repositório para ser usada no modo claro.
light: string;
// Texto alternativo para tornar a imagem acessível à tecnologia assistiva
alt?: string;
}
| {
// HTML bruto para utilizar no slot de imagem.
// Pode ser uma tag `<img>` personalizada ou um `<svg>` inline.
html: string;
};
actions?: Array<{
text: string;
link: string;
Expand Down
2 changes: 2 additions & 0 deletions docs/src/content/docs/reference/overrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ The default implementation shows a large title, tagline, and call-to-action link
Component rendered around each page’s main content.
The default implementation sets up basic styles to apply to Markdown content.

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

---

### Footer
Expand Down
22 changes: 22 additions & 0 deletions docs/vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",

"routes": [
{
"src": "^/_astro/(.*)$",
"headers": { "cache-control": "public, max-age=31536000, immutable" },
"continue": true
},

{ "src": "/(ph$|ph/)(.*)", "dest": "https://astro-houston-ph.pages.dev/ph/$2" },

{ "src": "(.*)/([^./]+)$", "dest": "$1/$2/", "status": 301 },
{ "src": "(.*)/index.html$", "dest": "$1/", "status": 301 },

{ "handle": "filesystem" },

{ "src": "/zh/(.*)", "dest": "/zh-cn/$1", "status": 301 },

{ "src": "/(?<lang>[^/]*)/(.*)", "dest": "/$lang/404/", "status": 404 }
]
}
2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/starlight": "^0.12.0",
"@astrojs/starlight": "^0.12.1",
"astro": "^3.2.3",
"sharp": "^0.32.5"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/tailwind/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/starlight": "^0.12.0",
"@astrojs/starlight": "^0.12.1",
"@astrojs/starlight-tailwind": "^2.0.1",
"@astrojs/tailwind": "^5.0.0",
"astro": "^3.2.3",
Expand Down
12 changes: 12 additions & 0 deletions packages/starlight/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @astrojs/starlight

## 0.12.1

### Patch Changes

- [#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

- [#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

- [#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

- [#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`

## 0.12.0

### Minor Changes
Expand Down
40 changes: 40 additions & 0 deletions packages/starlight/__tests__/basics/sitemap.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { describe, expect, test } from 'vitest';
import { getSitemapConfig, starlightSitemap } from '../../integrations/sitemap';
import type { StarlightConfig } from '../../types';
import { StarlightConfigSchema, type StarlightUserConfig } from '../../utils/user-config';

describe('starlightSitemap', () => {
test('returns @astrojs/sitemap integration', () => {
const integration = starlightSitemap({} as StarlightConfig);
expect(integration.name).toBe('@astrojs/sitemap');
});
});

describe('getSitemapConfig', () => {
test('configures i18n config', () => {
const config = getSitemapConfig(
StarlightConfigSchema.parse({
title: 'i18n test',
locales: { root: { lang: 'en', label: 'English' }, fr: { label: 'French' } },
} satisfies StarlightUserConfig)
);
expect(config).toMatchInlineSnapshot(`
{
"i18n": {
"defaultLocale": "root",
"locales": {
"fr": "fr",
"root": "en",
},
},
}
`);
});

test('no config for monolingual sites', () => {
const config = getSitemapConfig(
StarlightConfigSchema.parse({ title: 'i18n test' } satisfies StarlightUserConfig)
);
expect(config).toMatchInlineSnapshot('{}');
});
});
Loading

0 comments on commit 968746f

Please sign in to comment.