Page layouts#
Clarity Theme for Sphinx supports multiple page layouts suitable for different kinds of documentation, or parts of documentation. Layouts change overall page structure.
Default layout#
Traditional three‑column: global table of contents (ToC) on the left, document content center, local ToC (“On this page”) on the right.
Compact layout#
Two‑column: no global ToC; local ToC on the right. Suitable for README‑style or single‑page docs where a global ToC would be empty.
Changing layout#
If you want to change layout, you can set it for a whole documentation or individual pages only.
Set layout globally
In
conf.py’shtml_theme_options, setdefault_layoutoption to layout name.html_theme_options = { "default_layout": "compact" }
Set layout per page (override global)
Add
layoutmetadata at the top of the Markdown or reStructuredText document.:layout: compact Welcome to my project! ----------------------
--- layout: compact --- # Welcome to my project!