Skip to content

Commit

Permalink
i18n(ja): Update configuration.md (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
morinokami committed Jun 21, 2023
1 parent 6219d87 commit 93f2717
Showing 1 changed file with 18 additions and 26 deletions.
44 changes: 18 additions & 26 deletions docs/src/content/docs/ja/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,23 @@ starlight({

### `sidebar`

**type:** [`SidebarGroup[]`](#sidebargroup)
**type:** [`SidebarItem[]`](#sidebaritem)

サイトのサイドバーのナビゲーション項目を設定します。

サイドバーはグループごとに`label`をもつ配列で、`items`配列または`autogenerate`設定オブジェクトのいずれかを含みます
サイドバーはリンクとリンクのグループの配列です。各項目は、`label`と以下のプロパティのいずれかが必要です

リンクとサブグループを含む配列である`items`により、グループの内容を手動で設定できます。また、`autogenerate`を使用して、ドキュメントの特定のディレクトリからグループの内容を自動的に生成することも可能です。
- `link` — 特定のURL、たとえば`'/home'``'https://example.com'`などへの単一のリンク。

- `items` — サイドバーの複数のリンクとサブグループを含む配列。

- `autogenerate` — リンクのグループを自動的に生成するために、ドキュメントのディレクトリを指定するオブジェクト。

```js
starlight({
sidebar: [
// 「ホーム」というラベルのついた単一のリンク。
{ label: 'ホーム', link: '/' },
// 2つのリンクを含む、「ここから始める」というラベルのついたグループ。
{
label: 'ここから始める',
Expand All @@ -101,7 +107,7 @@ starlight({
{ label: '次のステップ', link: '/next-steps' },
],
},
// 参照先のディレクトリのすべてのページにリンクするグループ
// referenceディレクトリのすべてのページにリンクするグループ
{
label: 'リファレンス',
autogenerate: { directory: 'reference' },
Expand Down Expand Up @@ -140,31 +146,17 @@ sidebar: [
];
```

#### `SidebarGroup`

```ts
type SidebarGroup =
| {
label: string;
translations?: Record<string, string>;
items: Array<LinkItem | SidebarGroup>;
}
| {
label: string;
translations?: Record<string, string>;
autogenerate: {
directory: string;
};
};
```

#### `LinkItem`
#### `SidebarItem`

```ts
interface LinkItem {
type SidebarItem = {
label: string;
link: string;
}
translations?: Record<string, string>;
} & (
| { link: string }
| { items: SidebarItem[] }
| { autogenerate: { directory: string } }
);
```

### `locales`
Expand Down

0 comments on commit 93f2717

Please sign in to comment.