> 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%2Fgit-blob-aa4fe159ecc96a17143a21cba5208c1a140e21c1%2F25_12_10_adding_a_section%402x.png?alt=media" alt="A GitBook screenshot showing a docs site&#x27;s structure"><figcaption></figcaption></figure>

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

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

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

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

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

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

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

バリアントを追加するには、追加先のセクションにある **バリアントを追加** ボタンをクリックし、追加するコンテンツを選択します。新しいバリアントは、選択したセクションのバリアント一覧に追加され、サイトのバリアント選択メニューから訪問者が選べるようになります。

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

各バリアントの名前とスラッグを変更するには、編集するバリアントの行にある <picture><source srcset="broken://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%2Fgit-blob-d28f11ed4dfafb06aa9c6ae92db8017d94014317%2F25_01_10_edit_icon_light.svg?alt=media" alt="The Edit icon in GitBook"></picture> **編集** ボタンをクリックします。モーダルが開くので、変更するフィールドを編集してから、 **保存** ボタンをクリックして保存します。また、 **バリアントを削除** ボタンを左下でクリックして、バリアントを削除することもできます。

サイトが複数の言語に対応している場合は、バリアントのタイトルを翻訳して、選択メニューに各言語のラベルを表示することもできます。詳しくは、 [多言語セクション](https://gitbook.com/docs/documentation/ja-gitbook-documentation/manage-your-site/site-structure/multilingual-sections.md).

{% hint style="info" %}
バリアントのスラッグを変更すると、正規 URL も変わります。GitBook は旧 URL から新 URL へのリダイレクトを自動的に作成します。また、 [リダイレクトを手動で作成](https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/site-redirects.md).
{% endhint %}

バリアントのコンテンツを置き換えるには、まずそのバリアントの **編集** <picture><source srcset="broken://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%2Fgit-blob-d28f11ed4dfafb06aa9c6ae92db8017d94014317%2F25_01_10_edit_icon_light.svg?alt=media" alt="The Edit icon in GitBook"></picture> ボタンをクリックして削除し、モーダルの左下にある **削除** ボタンをクリックします。バリアントを削除したら、 **バリアントを追加** ボタンをクリックして、新しいコンテンツを追加します。

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

サイトでは、 **サイト構造** テーブルに表示されている順序でバリアントが表示されます。バリアントの順序を変更するには、 **ドラッグハンドル** <picture><source srcset="broken://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%2Fgit-blob-23f3e8f05326b0d239d32d28bba99c1d46f204f7%2F25_01_10_options_light.svg?alt=media" alt="The Options menu icon in GitBook"></picture> をつかんで上下に移動します。変更した順序はすぐにサイトに反映されます。

をつかんで並べ替えることもできます。また、キーボードを使ってコンテンツの選択と移動もできます。スペースバーでセクションまたはバリアントを選択し、矢印キーで上下に移動します。もう一度スペースバーを押して、新しい位置を確定します。

### デフォルトのバリアントを設定する

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

バリアントをデフォルトに設定するには、そのバリアントの行にある **アクションメニュー** <picture><source srcset="broken://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%2Fgit-blob-aabbca522107ef561981bdfe5af94605b31e0920%2F25_01_10_actions_icon_light.svg?alt=media" alt="The Actions menu icon in GitBook"></picture> をクリックしてから、 **デフォルトに設定**.

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

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

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

削除するバリアントの **アクションメニュー** <picture><source srcset="broken://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%2Fgit-blob-aabbca522107ef561981bdfe5af94605b31e0920%2F25_01_10_actions_icon_light.svg?alt=media" alt="The Actions menu icon in GitBook"></picture> を開き、 **削除**.

{% hint style="success" %}
サイトからバリアントを削除すると、公開中のサイトからは削除されますが、 **コンテンツ自体は削除されません** 。 [すべてのコンテンツ](https://gitbook.com/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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
