> 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/docs-as-code/git-sync/content-configuration.md).

# コンテンツ設定

Git Sync をさらに設定したい場合は、 `.gitbook.yaml` そのセクションで同期されるコンテンツのルートにファイルを追加して、GitBook に Git リポジトリの解析方法を伝えることができます。モノレポでは、そのファイルはそのセクションで設定された [プロジェクト ディレクトリ](/docs/documentation/ja-gitbook-documentation/docs-as-code/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/docs-as-code/git-sync/monorepos.md).
{% endhint %}

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

構造は次の 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 %}

### Summary <a href="#summary" id="summary"></a>

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

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

```markdown
# Summary

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

* [最初のページのタイトル](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
# Summary

* [ページのメインタイトル](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/docs-as-code/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.
