Template Shell
Hugo Template Shell
The HTML template shell is the outer contract for every generated website page. It decides the page type, emits shared chrome, mounts the rendered page body, and exposes enough metadata for editor/runtime layers to hydrate the page without becoming render authorities.
Composition Root
layouts/_default/baseof.html is the root HTML shell. It resolves:
- page kind and
data-ql-page-typevalues; - site archetype and shared body classes;
- editor enablement and source-path metadata;
- Chatwoot/support configuration;
- header, page chrome, main content, article navigation, footer, and overlays;
- hidden markdown source used by editor and source-view surfaces.
Site-specific layouts should not fork this shell for normal behavior. Prefer config, front matter, shared partial contracts, or small extension partials.
Page Templates
layouts/_default/single.html, layouts/_default/list.html, and
layouts/_default/home.html specialize the shell by choosing what appears in
the main block.
single.htmlrenders one content page throughpartials/main.html, then adds page-local bibliography/reference output and navigation where applicable.list.htmlrenders the section_index.mdcontent throughpartials/main.htmland then callsviews/summaries, so section pages automatically list their immediate children.home.htmlfollows the same shared body path with home-specific ordering and summary behavior.app.page.htmlis a PWA/app fallback page template and should be treated as a specialized shell, not the normal website body path.
The Markdown output templates, single.md and list.md, are different: they
emit raw source through utils/get_page_source_code. They are not the HTML docs
site path.
Main Body
layouts/partials/main.html owns the shared content body. It resolves inherited
section defaults, title behavior, section margin settings, gallery/form
surfaces, CV/resume actions, video/slideshow helpers, last-updated sections,
newsletter flags, definitions output, KaTeX helper assets, and the handoff into
the section renderer.
The important boundary is:
main.htmlprepares page-level context and section defaults;page/sections/index.htmlsplits and contracts individual authored sections;page/sections/render.htmlemits the final section DOM.
List Pages
HTML section pages should rely on Hugo list behavior unless there is a curated
reason not to. The generator’s list template calls views/summaries, which
filters and orders .Pages using shared ordering logic. A section _index.md
should usually contain only introduction or “start here” guidance; it does not
need to duplicate every child link by hand.
Files To Read
layouts/_default/baseof.htmllayouts/_default/single.htmllayouts/_default/list.htmllayouts/_default/home.htmllayouts/partials/main.htmllayouts/partials/views/summaries.html