> 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/getting-started/git-sync/content-configuration.md).

# コンテンツ設定

Git Sync をさらに設定したい場合は、次を追加できます。 `.gitbook.yaml` そのセクションで同期されるコンテンツのルートに、その Git リポジトリの解析方法を GitBook に伝えるためのファイルを配置します。モノレポでは、そのファイルはセクションに設定された [プロジェクト ディレクトリ](/docs/documentation/ja-gitbook-documentation/getting-started/git-sync/monorepos.md).

{% code title=".gitbook.yaml" %}

```yaml
root: ./

structure:
  readme: README.md
  summary: SUMMARY.md

redirects:
  previous/page: new-folder/page.md
```

{% endcode %}

### ルート

ドキュメントを検索するパスの既定値は、リポジトリのルート ディレクトリです。GitBook に次の場所を参照させる方法は次のとおりです。 `./docs` フォルダー:

{% code title=".gitbook.yaml" %}

```yaml
root: ./docs/
```

{% endcode %}

{% hint style="warning" %}
**パスを指定するその他のすべてのオプションは、このルート フォルダーに対する相対パスになります**。したがって、root を次のように定義すると `./docs/` そのうえで `structure.summary` として `./product/SUMMARY.md`、GitBook は実際には次の場所のファイルを探します `./docs/product/SUMMARY.md`。
{% endhint %}

{% hint style="info" %}
モノレポでは、 `root` は、リポジトリのルートではなく、同期されたセクションのプロジェクト ディレクトリを基準に解決されます。パスベースの設定は、そのセクションの同期スコープ内にのみ適用されます。兄弟ディレクトリやリポジトリ レベルのフォルダーが、他のセクションで自動的に利用できるようにはなりません。複数セクションのリポジトリ構成については、次を参照してください [モノレポ](/docs/documentation/ja-gitbook-documentation/getting-started/git-sync/monorepos.md).
{% endhint %}

### 構成 <a href="#structure" id="structure"></a>

structure では 2 つのプロパティを指定できます:

* **`readme`**：ドキュメントの最初のページです。既定値は `./README.md`
* **`summary`**：ドキュメントの目次です。既定値は `./SUMMARY.md`

これらのプロパティの値は、対応するファイルへのパスです。パスは「root」オプションからの相対パスです。たとえば、GitBook に次の場所を参照させる方法は次のとおりです。 `./product` フォルダーを最初のページと summary に使う場合:

{% code title=".gitbook.yaml" %}

```yaml
structure:
  readme: ./product/README.md
  summary: ./product/SUMMARY.md
```

{% endcode %}

{% hint style="warning" %}
Git Sync が有効な場合、 **readme ファイルを新規作成したり変更したりしないようにしてください** GitBook の UI からは行わないでください。競合や重複の問題を避けるため、readme ファイルは GitHub/GitLab リポジトリでのみ管理してください。
{% endhint %}

### 目次 <a href="#summary" id="summary"></a>

その `summary` ファイルは Markdown ファイル（`.md`）で、次の構成にする必要があります：

{% code title="./SUMMARY.md" %}

```markdown
# 目次

## このように見出しを使ってページグループを作成します

* [最初のページのタイトル](page1/README.md)
    * [子ページ](page1/page1-1.md)
    * [別の子ページ](part1/page1-2.md)

* [2 番目のページのタイトル](page2/README.md)
    * [子ページ](page2/page2-1.md)
    * [別の子ページ](part2/page2-2.md)

## 2 番目のページグループ

* [別のページ](another-page.md)
```

{% endcode %}

カスタム summary ファイルの指定は任意です。既定では、GitBook は次の名前のファイルを探します `SUMMARY.md` あなたの `root` フォルダーを、設定ファイルで指定している場合はそのフォルダー内、そうでなければリポジトリのルートで探します。

summary を指定せず、GitBook が次のファイルを見つけられない場合、 `SUMMARY.md` ドキュメントのルートにファイルがあると、GitBook はフォルダー構成と以下の Markdown ファイルから目次を推測します。

{% hint style="info" %}
summary Markdown ファイルは **次の内容を反映したものです** **目次** GitBook セクションの目次です。したがって、初回インポート時に summary ファイルが提供されていない場合でも、GitBook はそれを作成し、GitBook エディタでコンテンツを更新するたびに更新します。

そのため、同じ Markdown ファイルをあなたの `SUMMARY.md` ファイルで 2 回参照することはできません。これは、1 つのページが GitBook セクション内で 2 つの異なる URL に存在することを意味するためです。
{% endhint %}

#### 目次（サイドバー）のタイトル <a href="#sidebar-titles" id="sidebar-titles"></a>

ページ本文とは異なるタイトルを目次サイドバーに表示したい場合は、任意の **ページリンクタイトル** あなたの `SUMMARY.md` ファイルを定義できます。

Git Sync を使っている場合、ページリンクタイトルはページリンクで設定します：

{% code title="./SUMMARY.md" %}

```markdown
# 目次

* [ページのメインタイトル](page.md "ページリンクタイトル")
```

{% endcode %}

引用符内のテキスト（`「ページリンクタイトル」`）が使用されます：

* 目次（サイドバー）内で
* 各ページ下部のページ送りボタン内で
* そのページに追加した相対リンク内で

ページリンクタイトルは任意です。手動で追加しない場合、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/getting-started/git-sync/content-configuration.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.
