# Layouts Layouts define the page structure (left sidebar, full width, etc.). Layouts are defined in `theme.json` and chosen via frontmatter in content files. ## Choosing a layout in content ```markdown --- layout: left_sidebar --- # Page title Content... ``` ## Layouts in theme.json Layouts are defined in the `template` mapping. The `config.default_template` is the fallback for pages without a `layout:` frontmatter or with an unknown layout: ```json { "config": { "default_template": "full_content" }, "template": { "full_content": "full_content.twig", "left_sidebar": "left_sidebar.twig", "right_sidebar": "right_sidebar.twig", "custom1": "custom1.twig", "guide": "guide.twig" } } ``` ## Layout template A layout template extends `base.twig` and fills the `content` block: ```twig {% extends 'base.twig' %} {% block content %}
{{ content|raw }}
{% endblock %} ``` ## Layouts with sidebar Layouts with a sidebar can show plugin content: ```twig {% extends 'base.twig' %} {% block content %}
{{ content|raw }}
{% endblock %} ``` If a page has no plugins or the layout has no sidebar, `sidebar_content` is empty. ## Guide layout The `guide` layout (`guide.twig`) is special for guides. It injects the Navigation plugin into the sidebar for sidebar navigation. Automatically used for pages in the `guide/` folder.