> 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/manage-your-site/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" %}
バリアントにはどんなコンテンツでも含められますが、次の用途として使うことをおすすめします *同じコンテンツのバリエーション*。コンテンツの意味が異なる場合は、代わりに [sections](/docs/documentation/ja-gitbook-documentation/manage-your-site/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/manage-your-site/site-structure/multilingual-sections.md).

{% hint style="info" %}
バリアントのスラッグを変更すると、その正規URLが変更されます。GitBook は古いURLから新しいURLへの自動リダイレクトを作成します。さらに、 [リダイレクトを手動で作成することもできます](/docs/documentation/ja-gitbook-documentation/publish/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/create-content/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/manage-your-site/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.
