> For the complete documentation index, see [llms.txt](https://gitbook-open-v2-preview.gitbook.workers.dev/url/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-open-v2-preview.gitbook.workers.dev/url/gitbook.com/docs/documentation/ja-gitbook-documentation/getting-started/git-sync/content-configuration.md).

# コンテンツ設定

Git Sync をさらに設定したい場合は、 `.gitbook.yaml` そのスペースに同期されたコンテンツのルートにファイルを置くと、GitBook に Git リポジトリの解析方法を伝えられます。モノレポでは、そのファイルはスペースで設定された [プロジェクト ディレクトリ](/url/gitbook.com/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` は、リポジトリのルートではなく、同期されたスペースのプロジェクト ディレクトリを基準に解決されます。パスベースの設定は、そのスペースの同期範囲内でのみ適用されます。兄弟ディレクトリやリポジトリ レベルのフォルダーが、他のスペースで自動的に利用可能になるわけではありません。複数スペースのリポジトリ構成については、 [モノレポ](/url/gitbook.com/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 ではなく、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:

```
GET https://gitbook-open-v2-preview.gitbook.workers.dev/url/gitbook.com/docs/documentation/ja-gitbook-documentation/getting-started/git-sync/content-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
