> 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 は 3 つのファイルを使用します。必要な Git Sync の部分を制御するファイルを選択してください:

* `docs.yaml` サイトを設定し、スペースをリポジトリのディレクトリにマッピングします。
* `.gitbook.yaml` GitBook が 1 つのスペースのコンテンツをどのように読み取るかを設定します。
* `SUMMARY.md` スペースのナビゲーションを定義します。

### docs.yaml でサイトを設定する

`docs.yaml` サイト全体を設定します。Git Sync プロジェクト ディレクトリにあります。指定しない場合、GitBook はリポジトリのルートを使用します **プロジェクト ディレクトリ**.

使用する `docs.yaml` サイト構造を定義し、各スペースをディレクトリにマッピングするために使用します。site.structure 内の各項目は `site.structure` 安定した `キー`。スペースの `content.directory` そのリポジトリのディレクトリを設定します。

この例では、英語とフランス語のスペースを別々のディレクトリにマッピングしています:

{% code title="docs.yaml" expandable="true" %}

```yaml
$schema: https://api.gitbook.com/openapi.yaml#/components/schemas/GitSyncSiteConfig
site:
  title: ドキュメント
  structure:
    - type: section
      key: documentation
      title: ドキュメント
      path: documentation
      children:
        - type: space
          key: docs-en
          title: 英語
          path: docs
          default: true
          content:
            directory: ./docs/en
            language: en
        - type: space
          key: docs-fr
          title: フランス語
          path: fr
          content:
            directory: ./docs/fr
            language: fr
```

{% endcode %}

<details>

<summary>追加のサイト プロパティを設定する</summary>

次の任意プロパティを使用して、サイト構造を細かく調整できます:

| Property               | 用途                                   |
| ---------------------- | ------------------------------------ |
| `type: section-group`  | 関連するセクションを共有のナビゲーション見出しの下にまとめます。     |
| `description`          | セクションに説明を追加します。                      |
| `icon`                 | セクションまたはセクション グループにアイコンを追加します。       |
| `localizedTitle`       | セクション、セクション グループ、またはスペースのタイトルを翻訳します。 |
| `localizedDescription` | セクションの説明を翻訳します。                      |
| `hidden`               | スペースをサイト ナビゲーションから非表示にします。           |

GitBook は作成または更新します `docs.yaml` サイトのコンテンツ マッピングを保存するときに。

</details>

### .gitbook.yaml でスペースを設定する

`.gitbook.yaml` 1 つのスペースを設定します。そのスペースにマッピングされたディレクトリにあります。コンテンツのルート、最初のページ、ナビゲーション ファイル、リダイレクトを設定するために使用します。

主な設定は次のとおりです:

* `root` GitBook が読み取るディレクトリを設定します。既定値は `./`.
* `structure.readme` 最初のページを設定します。既定値は `README.md`.
* `structure.summary` ナビゲーション ファイルを設定します。既定値は `SUMMARY.md`.
* `redirects` スペース内の古いパスを新しいパスにマッピングします。

以下は一般的な設定例です:

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

```yaml
root: ./

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

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

{% endcode %}

#### コンテンツのルートを設定する

設定する `root` スペースのコンテンツがサブディレクトリ内にある場合:

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

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

{% endcode %}

{% hint style="warning" %}
〜内のパス `.gitbook.yaml` 〜に対して相対的です `root`。〜を使うと `root: ./docs/`, `structure.summary: ./product/SUMMARY.md` 〜に解決されます `./docs/product/SUMMARY.md`.
{% endhint %}

モノレポでは、 `root` マッピングされたスペース ディレクトリ内にのみ適用されます。兄弟ディレクトリは利用できるようになりません。複数スペースのリポジトリ構成については、 [モノレポ](/docs/documentation/ja-gitbook-documentation/docs-as-code/git-sync/monorepos.md).

#### 最初のページとナビゲーション ファイルを設定する

使用する `structure.readme` と `structure.summary` カスタム ファイル パスを設定するために:

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

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

{% endcode %}

{% hint style="warning" %}
Git Sync が有効な場合は、管理してください `README.md` リポジトリ内のファイル。GitBook で編集すると、競合や重複ページが発生する可能性があります。
{% endhint %}

#### リダイレクトを設定する

スペース レベルのリダイレクトを設定するには `.gitbook.yaml`。リダイレクト パスはそのスペース内でのみ適用されます。

GitBook アプリでサイト レベルのリダイレクトも管理できます。 [サイトのリダイレクト](/docs/documentation/ja-gitbook-documentation/suru/site-redirects.md).

### SUMMARY.md でナビゲーションを設定する

`SUMMARY.md` スペースの目次を定義します。GitBook は設定された `root` ディレクトリ内でそれを探します。

GitBook が `SUMMARY.md`見つけられない場合、フォルダと Markdown ファイルからナビゲーションを推測します。GitBook は作成または更新します `SUMMARY.md` GitBook でナビゲーションを変更するときに。

ページ グループには見出しを、子ページには入れ子のリンクを使用します:

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

```markdown
# 要約

## 製品

* [概要](README.md)
  * [はじめに](getting-started.md)
  * [設定](configuration.md)

## リファレンス

* [API リファレンス](api.md)
```

{% endcode %}

各 Markdown ファイルは `SUMMARY.md`に 1 回だけ表示できます。1 つのページが 1 つのスペース内で持てる URL は 1 つだけです。

#### ナビゲーション ラベルを設定する

ナビゲーション ラベルがページ タイトルと異なる場合は、ページリンクのタイトルを追加します:

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

```markdown
# 要約

* [ページのメインタイトル](page.md "ナビゲーション ラベル")
```

{% endcode %}

GitBook はサイドバー、ページネーション、相対リンクでページリンクのタイトルを使用します。指定しない場合、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.
