> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/ja-gitbook-documentation/saitowosuru/site-structure/variants.md).

# コンテンツバリアント

1つのサイトで、複数の製品バージョンや言語のドキュメントを公開します

同じドキュメントの複数バージョンを、1つのドキュメントサイトの一部として公開できます。これらのバリアントは、公開サイトの目次上部にあるバリアントピッカーから、エンドユーザーが利用できます。

<figure><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F2cQxJ5sTMVUkXOcuDEU8%2FAdding%20a%20section%402x.png?alt=media&amp;token=2bd96c5f-0945-4d86-a835-a94102e627d9" alt="A GitBook screenshot showing a docs site&#x27;s structure"><figcaption></figcaption></figure>

### 複数の言語やバージョンを追加する

複数のバリアントを持つサイトは、コンテンツのバリエーションをまとめて管理する必要がある場合に便利です。たとえば、API の複数バージョン（v1、v2、v3 など）をドキュメント化する場合や、異なる言語でコンテンツをドキュメント化する場合です。

{% hint style="info" %}
バリアントにはどんなコンテンツでも含められますが、次のような用途で使うことをおすすめします *同じコンテンツのバリエーション*。コンテンツの意味が異なる場合は、別のものとして追加することを検討してください [セクション](/docs/documentation/ja-gitbook-documentation/saitowosuru/site-structure/site-sections.md) 代わりにこちらを使用してください。
{% endhint %}

翻訳や複数言語をバリアントとして追加する場合は、ドキュメントを閲覧するユーザーに最適な体験を提供するため、バリアントの言語を設定するのがベストプラクティスです。

言語を設定した複数のバリアントを追加すると、言語ピッカーは右上に移動し、既定のバリアントピッカーよりもすっきりした、より直接的な体験になります。

### ドキュメントサイトにバリアントを追加する

構造エディターを開くには **サイト構造**、 **全般** サイトのサイドバー内にあります。ここでサイトのすべてのコンテンツを確認できます。

バリアントを追加するには、 **バリアントを追加** 追加したいセクションのボタンをクリックし、追加するコンテンツを選択します。新しいバリアントは、選択したセクション内のバリアント一覧に追加され、サイトのバリアントのドロップダウンから訪問者が利用できるようになります。

### バリアントを変更する

各バリアントの名前とスラッグは、編集したいバリアントの表の行にある <picture><source srcset="/files/kN09oTFtAuyaxNIwWuCt" media="(prefers-color-scheme: dark)"><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FA3OfGjPkE5GnOQvN36jN%2Fedit.svg?alt=media&amp;token=6f70239f-d889-4e64-9ec6-4801df47a48d" alt="The Edit icon in GitBook"></picture> **編集** この操作でモーダルが開きます。変更したいフィールドを編集し、次に **保存** 保存するには、 **バリアントを削除する** 左下のボタンをクリックします。

サイトが複数言語をサポートしている場合、バリアントのタイトルを翻訳して、ピッカーにローカライズされたラベルを表示することもできます。詳細は [多言語セクション](/docs/documentation/ja-gitbook-documentation/saitowosuru/site-structure/multilingual-sections.md).

{% hint style="info" %}
バリアントのスラッグを変更すると、その正規 URL も変更されます。GitBook は古い URL から新しい URL への自動リダイレクトを作成します。また、 [手動でリダイレクトを作成することもできます](/docs/documentation/ja-gitbook-documentation/suru-1/site-redirects.md).
{% endhint %}

バリアントのコンテンツを置き換えるには、まずその **編集** <picture><source srcset="/files/kN09oTFtAuyaxNIwWuCt" media="(prefers-color-scheme: dark)"><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FA3OfGjPkE5GnOQvN36jN%2Fedit.svg?alt=media&amp;token=6f70239f-d889-4e64-9ec6-4801df47a48d" alt="The Edit icon in GitBook"></picture> ボタンをクリックして削除し、その後 **削除** モーダルの左下にある **バリアントを追加** 新しいコンテンツを追加するボタンをクリックします。

### バリアントの並べ替え

サイトでは、バリアントはあなたの **サイト構造** 表に表示される順序で表示されます。バリアントは、 **ドラッグハンドル** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt="The Options menu icon in GitBook"></picture> をつかんで上下に移動することで並べ替えられます。変更後の順序はすぐにサイトに反映されます。

スペースバーでセクションまたはバリアントを選択してから、矢印キーで上下に移動できます。スペースバーをもう一度押すと、新しい位置が確定します。

### 既定のバリアントを設定する

セクション内に複数のバリアントがある場合、そのうち1つが既定としてマークされます。このバリアントは、訪問者がサイトにアクセスしたとき（またはセクションにアクセスしたとき）に表示されます。その他のバリアントにはそれぞれ、サイトの URL に付加されるスラッグがあります。

バリアントを既定に設定するには、 **操作メニュー** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> バリアントの表の行にある **既定に設定**.

{% hint style="info" %}
バリアントを既定に設定すると、スラッグ欄は削除され、代わりにセクションのルートから配信されます。GitBook は、訪問者がコンテンツを引き続き表示できるように、バリアントのスラッグを適切なパスへリダイレクトします。
{% endhint %}

### サイトからバリアントを削除する

サイトからバリアントを削除するには、 **サイト構造**、 **全般** をサイトサイドバーから構造エディターを開き、削除したいコンテンツを見つけます。

〜を開き、 **操作メニュー** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> 削除したいバリアントの **削除**.

{% hint style="success" %}
サイトからバリアントを削除すると、公開サイトからも削除されますが **コンテンツ自体は削除されません** — それでも [すべてのコンテンツ](/docs/documentation/ja-gitbook-documentation/kontentsuwosuru/content-structure/all-content.md).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/documentation/ja-gitbook-documentation/saitowosuru/site-structure/variants.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
