Skip to content

Commit

Permalink
Merge branch 'main' into sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
delucis committed Jul 5, 2024
2 parents e84a3da + c3a4a73 commit edf09fc
Show file tree
Hide file tree
Showing 11 changed files with 84 additions and 74 deletions.
7 changes: 0 additions & 7 deletions .changeset/big-buttons-shop.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/curly-dolphins-grow.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changeset/great-plums-study.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/new-trains-complain.md

This file was deleted.

19 changes: 0 additions & 19 deletions .changeset/seven-owls-taste.md

This file was deleted.

70 changes: 46 additions & 24 deletions docs/src/content/docs/ko/reference/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,25 +99,34 @@ starlight({

사이트의 사이드바 탐색 항목을 구성합니다.

사이드바는 링크의 배열과 링크 그룹입니다. 각 항목은 `label`과 함께 다음 속성 중 하나를 반드시 포함해야합니다.
사이드바는 링크의 배열과 링크 그룹입니다.
`slug`를 사용하는 항목을 제외하고, 각 항목은 `label`과 함께 다음 속성 중 하나를 반드시 포함해야합니다.

- `link` — 특정 URL에 대한 단일 링크(예: `'/home'` 또는 `'https://example.com'`).

- `slug` — 내부 페이지에 대한 참조 (예: `'guides/getting-started'`).

- `items` — 더 많은 사이드바 링크와 하위 그룹을 포함하는 배열

- `autogenerate` — 링크 그룹을 자동으로 생성하기 위해 문서의 디렉터리를 지정하는 객체

내부 링크는 `slug` 속성이 있는 객체 대신 문자열로 지정할 수도 있습니다.

```js
starlight({
sidebar: [
// '홈'이라는 라벨이 붙은 단일 링크 항목
{ label: '', link: '/' },
// 개의 링크가 포함된 '여기서부터' 라는 라벨이 붙은 그룹
// 개의 링크가 포함된 '여기서부터' 라는 라벨이 붙은 그룹
{
label: '여기서부터',
items: [
{ label: '소개', link: '/intro' },
{ label: '다음 단계', link: '/next-steps' },
// 내부 링크에 `slug`를 사용합니다.
{ slug: 'intro' },
{ slug: 'installation' },
// 또는 내부 링크에 대한 약칭을 사용합니다.
'tutorial',
'next-steps',
],
},
// 'reference' 디렉터리의 모든 페이지에 연결되는 그룹
Expand All @@ -139,16 +148,13 @@ starlight({

자동 생성된 하위 그룹은 기본적으로 상위 그룹의 `collapsed` 속성을 따릅니다. 이를 변경하려면 `autogenerate.collapsed` 속성을 설정하세요.

```js {5,16}
```js {5,13}
sidebar: [
// 최소화된 링크 그룹
{
label: '최소화된 링크 모음',
collapsed: true,
items: [
{ label: '소개', link: '/intro' },
{ label: '다음 단계', link: '/next-steps' },
],
items: ['intro', 'next-steps'],
},
// 최소화된 자동 생성 하위 그룹을 포함하는 펼쳐진 그룹
{
Expand Down Expand Up @@ -190,21 +196,37 @@ sidebar: [
#### `SidebarItem`

```ts
type SidebarItem = {
label: string;
translations?: Record<string, string>;
badge?: string | BadgeConfig;
} & (
| {
link: string;
attrs?: Record<string, string | number | boolean | undefined>;
}
| { items: SidebarItem[]; collapsed?: boolean }
| {
autogenerate: { directory: string; collapsed?: boolean };
collapsed?: boolean;
}
);
type SidebarItem =
| string
| ({
translations?: Record<string, string>;
badge?: string | BadgeConfig;
} & (
| {
// 링크
link: string;
label: string;
attrs?: Record<string, string | number | boolean | undefined>;
}
| {
// 내부 링크
slug: string;
label?: string;
attrs?: Record<string, string | number | boolean | undefined>;
}
| {
// 링크 그룹
label: string;
items: SidebarItem[];
collapsed?: boolean;
}
| {
// 자동으로 생성된 링크 그룹
label: string;
autogenerate: { directory: string; collapsed?: boolean };
collapsed?: boolean;
}
));
```

#### `BadgeConfig`
Expand Down
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.24.5",
"@astrojs/starlight": "^0.25.0",
"astro": "^4.10.2",
"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.24.5",
"@astrojs/starlight": "^0.25.0",
"@astrojs/starlight-tailwind": "^2.0.3",
"@astrojs/tailwind": "^5.1.0",
"astro": "^4.10.2",
Expand Down
33 changes: 33 additions & 0 deletions packages/starlight/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# @astrojs/starlight

## 0.25.0

### Minor Changes

- [#2025](https://github.com/withastro/starlight/pull/2025) [`47f32c1`](https://github.com/withastro/starlight/commit/47f32c196c5d840a6a45799ddf123d17c77274b0) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Removes the `/` search shortcut for [accessibility reasons](https://www.w3.org/WAI/WCAG21/Understanding/character-key-shortcuts.html).

⚠️ **Potentially breaking change:** The `search.shortcutLabel` UI string has been removed. If you were using this string in your custom UI, you will need to update your code.

- [#2064](https://github.com/withastro/starlight/pull/2064) [`c5b47cb`](https://github.com/withastro/starlight/commit/c5b47cbe1242f0b29b9212db72fe26590ab57d88) Thanks [@SnowDingo](https://github.com/SnowDingo)! - Improves styling of Markdown tables to work better in different contexts, including against different background colours like when used in asides.

- [#2031](https://github.com/withastro/starlight/pull/2031) [`2bab648`](https://github.com/withastro/starlight/commit/2bab648be9ddc6bfe05562650b773f5158a9ed42) Thanks [@delucis](https://github.com/delucis)! - Makes sidebar entry parsing stricter in Starlight config

**⚠️ Potentially breaking change:** Previously Starlight would accept a sidebar entry that matched one of its expected shapes, even if it included additional properties. For example, including both `link` and `items` was considered valid, with `items` being ignored. Now, it is an error to include more than one of `link`, `items`, or `autogenerate` in a sidebar entry.

If you see errors after updating, look for sidebar entries in the Starlight configuration in `astro.config.mjs` that include too many keys and remove the one that was previously ignored.

- [#1874](https://github.com/withastro/starlight/pull/1874) [`eeba06e`](https://github.com/withastro/starlight/commit/eeba06ea7df962e8f0520e145d28b8c17cd32c18) Thanks [@lorenzolewis](https://github.com/lorenzolewis)! - Adds a new syntax for specifying sidebar link items for internal links

You can now specify an internal page using only its slug, either as a string, or as an object with a `slug` property:

```js
starlight({
title: 'Docs with easier sidebars',
sidebar: ['getting-started', { slug: 'guides/installation' }],
});
```

Starlight will use the linked page’s frontmatter to configure the sidebar link.

### Patch Changes

- [#2081](https://github.com/withastro/starlight/pull/2081) [`f0181d2`](https://github.com/withastro/starlight/commit/f0181d2689248a46ff3eb6fc604bfcd95d4cb1aa) Thanks [@andrii-bodnar](https://github.com/andrii-bodnar)! - Updates the Ukrainian UI translations

## 0.24.5

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/starlight/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@astrojs/starlight",
"version": "0.24.5",
"version": "0.25.0",
"description": "Build beautiful, high-performance documentation websites with Astro",
"scripts": {
"test": "vitest",
Expand Down
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit edf09fc

Please sign in to comment.