.gitbook.yaml file at the root of your repository to tell GitBook how to parse your Git repository.
Basic configuration
Here’s a basic example of a.gitbook.yaml configuration file:
.gitbook.yaml
Root
The path to lookup for your documentation defaults to the root directory of the repository. Here’s how you can tell GitBook to look into a./docs folder:
.gitbook.yaml
Structure
The structure accepts two properties:readme: Your documentation’s first page. Its default value is./README.mdsummary: Your documentation’s table of contents. Its default value is./SUMMARY.md
./product folder for the first page and summary:
.gitbook.yaml
Summary file format
Thesummary file is a Markdown file (.md) that should have the following structure:
SUMMARY.md
SUMMARY.md in your root folder if specified in your config file, or at the root of the repository otherwise.
If you don’t specify a summary, and GitBook does not find a SUMMARY.md file at the root of your docs, GitBook will infer the table of contents from the folder structure and the Markdown files below.
The summary markdown file is a mirror of the table of contents of your GitBook space. So even when no summary file is provided during an initial import, GitBook will create one and/or update it whenever you update your content using the GitBook editor.Because of this, it’s not possible to reference the same Markdown file twice in your
SUMMARY.md file, because this would imply that a single page lives at two different URLs in your GitBook space.Table of contents titles
If you want your pages to have a different title in the table of contents sidebar than on the page itself, you can define an optional page link title in yourSUMMARY.md file.
If you’re using Git Sync, the page link title is set on the page link:
SUMMARY.md
"Page link title") will be used:
- In the table of contents (sidebar)
- In the pagination buttons at the bottom of each page
- In any relative links you add to that page
Redirects
Redirects allow you to define redirects in your.gitbook.yaml configuration file. The path is relative to the “root” option. For example, here’s how you can tell GitBook to redirect users accessing a past url /help to a new url /support
.gitbook.yaml
Redirects you define in a space’s configuration file are scoped to the corresponding space. We recommend creating site redirects for most cases as they apply to the whole site, across spaces.