> 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つのドキュメントサイトの一部として公開できます。これらのバリアントは、公開サイトの目次上部にあるバリアントピッカーからエンドユーザーが利用できます。

<figure><img src="/files/da51139d161c76e7445f22145d84070d1f8e7d18" 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="/files/cf8d2e633662cf4942b8e74c790dfbd311d960b3" 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/gong-kai/site-redirects.md).
{% endhint %}

バリアントのコンテンツを置き換えるには、まずその **編集** <picture><source srcset="/files/kN09oTFtAuyaxNIwWuCt" media="(prefers-color-scheme: dark)"><img src="/files/cf8d2e633662cf4942b8e74c790dfbd311d960b3" alt="The Edit icon in GitBook"></picture> ボタンをクリックして削除し、次に **削除** ボタンをモーダル左下でクリックして削除します。バリアントが削除されたら、次の **バリエーションを追加** ボタンをクリックして新しいコンテンツを追加します。

### バリアントの順序を並べ替える

サイトでは、バリアントがあなたの **サイト構造** テーブルに表示される順序で表示されます。バリアントは、次をつかんで並べ替えできます **ドラッグハンドル** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="/files/ce0e0a07ded643c4e219bbfe214239e291d0c7a1" alt="The Options menu icon in GitBook"></picture> に表示される順序で表示されます。ドラッグハンドルをつかんで上下に移動することで並べ替えられます。変更後の順序はすぐにサイトに反映されます。

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

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

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

バリアントを既定に設定するには、次の **アクションメニュー** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="/files/3489a3405c2f5c8e7f31c02ff44e42d2e3e8dbf6" 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="/files/3489a3405c2f5c8e7f31c02ff44e42d2e3e8dbf6" 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.
