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-type values;
  • 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.html renders one content page through partials/main.html, then adds page-local bibliography/reference output and navigation where applicable.
  • list.html renders the section _index.md content through partials/main.html and then calls views/summaries, so section pages automatically list their immediate children.
  • home.html follows the same shared body path with home-specific ordering and summary behavior.
  • app.page.html is 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.html prepares page-level context and section defaults;
  • page/sections/index.html splits and contracts individual authored sections;
  • page/sections/render.html emits 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.html
  • layouts/_default/single.html
  • layouts/_default/list.html
  • layouts/_default/home.html
  • layouts/partials/main.html
  • layouts/partials/views/summaries.html