icon | description |
---|---|
window-restore |
Add structure to your published documentation using site sections and variants |
The content on your site comes from spaces in your organization. You can link one or multiple spaces. GitBook will publish each one and handle the navigation between spaces.
Linked spaces can serve as one of two different content types, which determine how GitBook treats them in relation to each other and shows them to visitors.
Content variants | Publish multiple versions of the same content — ideal for localization, versioning, and more. | card_variants.svg | variants.md | |
Site sections | Split your site into distinct parts — ideal for multiple products or parts of your organization. | card_site_sections.svg | site-sections.md |
From your docs site’s dashboard, click the Settings
Your site starts out with a single section with your site's name and a single variant with the space you linked during your site's set-up.
The structure of a published docs site.
To add a site section, click the Add section button underneath the table and choose a space to link as a section. The new section is then added to the table and will be available to visitors as a tab at the top of your site.
To add a variant, click the Add variant button in the section you’d like to add to, then choose a space to link. The new variant is then added to the list of variants within the chosen section and will be available to visitors in the variant dropdown on your site.
When you add a space — as a variant or a section — a name and slug will be generated based on the space’s title.
You can change the name and slug of each of sections and variants by clicking the Edit
{% hint style="info" %} Changing a linked space's slug will change the space's canonical URL. GitBook will create an automatic redirect from the old URL to the new one. You can also manually create redirects. {% endhint %}
To replace a section or variant, first delete it by clicking its Edit
Your site displays sections and variants in the order that they appear in your Site structure table. They can be reordered by grabbing the Drag handle
You can also use the keyboard to select and move content. Select a section or variant with the space bar, then use the arrow keys to move it up or down. Hit the space bar again to confirm the new position.
If you have multiple sections in your site, one section will be marked as Default. This section is shown when visitors arrive on your site, and is served from your site’s root URL. Other sections each have a slug that is appended to the root URL.
If you have multiple variants within a section, one variant will be marked as the default. Like sections, the default variant is shown when visitors arrive on your site, or when they visit a section. Other variants each have a slug that’s appended to the section’s URL.
To set a space as default, click on the Actions menu
{% hint style="info" %} Setting a space as default removes its slug field, as it will be served from the section root instead. GitBooks redirects the space’s slug to the appropriate path, to ensure visitors keep seeing your content. {% endhint %}
To remove the content of a space from a site, click the Settings