> 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/saitoakusesu/adaptive-content/adapting-your-content.md).

# コンテンツの調整

認証方法を設定すると、そのデータを使ってサイト内のコンテンツをユーザーごとに調整できるようになります。

ドキュメントのさまざまな部分を調整・パーソナライズできます。たとえば次のようなものがあります:

* 非表示にする、または表示する [ページ](/docs/documentation/ja-gitbook-documentation/creating-content/content-structure/page.md)
* サイトを非表示にする、または表示する [バリアント](/docs/documentation/ja-gitbook-documentation/docs-site/site-structure/variants.md)
* サイトを非表示にする、または表示する [セクション](/docs/documentation/ja-gitbook-documentation/docs-site/site-structure/site-sections.md)
* 非表示にする、または表示する [ヘッダーリンク](/docs/documentation/ja-gitbook-documentation/docs-site/customization/layout-and-structure.md#header)
* 〜にパーソナライズされたコンテンツを追加する [インライン式](/docs/documentation/ja-gitbook-documentation/creating-content/variables-and-expressions.md)

### 条件エディタの使い方

条件エディタでは、ページ、バリアント、またはセクションを表示するか非表示にするかの条件を設定します。条件エディタを開くと、条件を次のような式として記述できます [式](/docs/documentation/ja-gitbook-documentation/creating-content/variables-and-expressions.md) 。これは、サイトの訪問者から届くデータに対して実行されます。

<figure><img src="/files/f238dec0966eb5968283373e5d5c535d04db5dad" alt=""><figcaption></figcaption></figure>

#### 例

ユーザーを通じてGitBookに渡したデータは、次のオブジェクトに付加されます `visitor.claims`.

では、〜のための条件文を書きたい場合の例を見てみましょう **ベータプログラムに参加しているユーザーにのみページを表示する** 場合を考えてみましょう。

```javascript
visitor.claims.isBetaUser == true
```

上の式は、このクレームに一致するユーザー、つまり `isBetaUser` は `true` ユーザーのクレーム内で true である場合、そのページを表示してアクセスできます。このクレームに一致しないユーザー（クレームが設定されていない訪問者を含む）は、そのページを表示したりアクセスしたりできません。

条件エディタにはオートコンプリートも組み込まれており、サイトの過去の訪問者から見つかったクレームや属性を候補として表示し、ページ、バリアント、またはセクションの条件文作成を助けます。

オートコンプリートを使うと、 [変数](/docs/documentation/ja-gitbook-documentation/creating-content/variables-and-expressions.md#use-variables-in-your-content) も利用できることに気づくでしょう。定義した変数と、ユーザーデータから取得したクレームを組み合わせて条件式を書くことができます。たとえば、次のようにできます:

1. 製品の最新バージョン用の変数を設定する
2. 次に、ドキュメントの訪問者が使用している製品のバージョンを示すクレームを設定する
3. 最後に、ユーザーがドキュメントの最新バージョンを使っている場合にのみ特定のページを表示する式を書く

有効なJavaScriptで書かれている限り、さまざまな種類の式を書くことができます。たとえば、条件エディタで複数のクレームを組み合わせて特定のユーザーに一致させるには、次の `&&` または `||` 演算子を使います。演算子について詳しくは [こちら](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators#binary_logical_operators).

### セグメントを使ったテスト

セグメントは、条件をテストするために設定できるモックユーザーデータを表します。

たとえば、エンタープライズプランの開発者や、無料プランのサインイン済みユーザーを表すセグメントを設定して、どのページが表示されるかを確認できます。

[セグメントの設定と使用について詳しくはこちら。](/docs/documentation/ja-gitbook-documentation/saitoakusesu/adaptive-content/testing-with-segments.md)

### 条件付きページ

ページの条件エディタを開くには、ページの横にあるアクションメニューを開き <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="/files/3489a3405c2f5c8e7f31c02ff44e42d2e3e8dbf6" alt="The Actions menu icon in GitBook"></picture> 、 **条件を追加。** 条件エディタは、 [ページのオプション](/docs/documentation/ja-gitbook-documentation/rissu/gitbook-ui.md#page-options).

ページにページ条件アイコンが表示されていれば、そのセクション内で条件が設定されているページを確認できます <picture><source srcset="/files/QtQtLiYwc1oJj119cgUz" media="(prefers-color-scheme: dark)"><img src="/files/3d64f0529a83b9e1d7a5e924729ec63c1401a2dc" alt="The Page condition icon in GitBook"></picture> その横にあります。

{% if visitor.claims.unsigned.bucket.IF\_BLOCK === true %}
**条件付きブロック**

条件付きブロックを追加するには、エディタで新しい行を開始し、 <kbd>/</kbd>と入力して、次に <picture><source srcset="/files/QtQtLiYwc1oJj119cgUz" media="(prefers-color-scheme: dark)"><img src="/files/3d64f0529a83b9e1d7a5e924729ec63c1401a2dc" alt="The Page condition icon in GitBook"></picture> **条件付きコンテンツ**.

ブロックの右上で、 <picture><source srcset="/files/QtQtLiYwc1oJj119cgUz" media="(prefers-color-scheme: dark)"><img src="/files/3d64f0529a83b9e1d7a5e924729ec63c1401a2dc" alt="The Page condition icon in GitBook"></picture> **条件** ボタンをクリックして条件を編集し、ブロックの表示/非表示を制御します。条件付きブロック内では、すべてのブロックタイプがサポートされているわけではありません。
{% endif %}

### 条件付きバリアント

バリアントの条件エディタを開くには、バリアントの横にあるアクションメニューを開き <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="/files/3489a3405c2f5c8e7f31c02ff44e42d2e3e8dbf6" alt="The Actions menu icon in GitBook"></picture> 、 **条件を追加**.

バリアントにページ条件アイコンが表示されていれば、ドキュメント内で条件が設定されているバリアントを確認できます <picture><source srcset="/files/QtQtLiYwc1oJj119cgUz" media="(prefers-color-scheme: dark)"><img src="/files/3d64f0529a83b9e1d7a5e924729ec63c1401a2dc" alt="The Page condition icon in GitBook"></picture> その横にあります。

### 条件付きセクション

セクションの条件エディタを開くには、セクションの横にあるアクションメニューを開き <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="/files/3489a3405c2f5c8e7f31c02ff44e42d2e3e8dbf6" alt="The Actions menu icon in GitBook"></picture> 、 **条件を追加**.

セクションにページ条件アイコンが表示されていれば、ドキュメント内で条件が設定されているセクションを確認できます <picture><source srcset="/files/QtQtLiYwc1oJj119cgUz" media="(prefers-color-scheme: dark)"><img src="/files/3d64f0529a83b9e1d7a5e924729ec63c1401a2dc" alt="The Page condition icon in GitBook"></picture> その横にあります。

### 条件付きページヘッダーリンク

ページヘッダーリンクの条件エディタを開くには、ヘッダーリンクの横にあるアクションメニューを開き <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="/files/3489a3405c2f5c8e7f31c02ff44e42d2e3e8dbf6" alt="The Actions menu icon in GitBook"></picture> 、 **条件を追加**.

リンクにページ条件アイコンが表示されていれば、ドキュメント内で条件が設定されているリンクを確認できます <picture><source srcset="/files/QtQtLiYwc1oJj119cgUz" media="(prefers-color-scheme: dark)"><img src="/files/3d64f0529a83b9e1d7a5e924729ec63c1401a2dc" alt="The Page condition icon in GitBook"></picture> その横にあります。

### インライン式

コンテンツの表示/非表示を制御するだけでなく、〜を使ってインラインでクレームを利用することもできます [式](/docs/documentation/ja-gitbook-documentation/creating-content/variables-and-expressions.md)、ページ変数やスペース変数と同じように。

式を使ってクレームをインライン参照するには、 <kbd>/</kbd> をエディタで入力し、次に <picture><source srcset="/files/HArsBmu3qFWO2SuJx7oR" media="(prefers-color-scheme: dark)"><img src="/files/97f2ba7f78b34e5a41e312efb76f404233fdf4b8" alt=""></picture> **式**を選択します。クレームは、式エディタで次のプロパティとして利用できます `visitor` .

### Git Sync の使い方

GitBookで設定した条件はGit Syncを通じて同期され、同期されたMarkdownページに表示されます。つまり、表示/非表示の条件が設定されたブロックやページは、同期先のリポジトリでも引き続き表示されます。

クレームを通じて渡されるデータはMarkdownには表示されず、安全にGitBookへ渡されます。


---

# 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/saitoakusesu/adaptive-content/adapting-your-content.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.
