Partial Index

Hugo Partial Index

This page is a generated reference inventory for documented Hugo partials. It only includes files that have a leading Hugo template comment docstring.

Use this as the broad API map. Use the narrative Hugo docs for how the pieces fit together.

Page Body And Chrome

layouts/partials/main.html

partials/main.html

Shared page body renderer for normal HTML pages.

Responsibilities:

  • emits page-level math/definition helpers needed by rendered content;
  • resolves inherited section defaults from site, section owner, top page, and current page;
  • resolves title, section style, margin, gallery, form, definitions, and update metadata;
  • delegates authored section splitting and section DOM output to page/sections/index.html.

Boundary:

  • Hugo remains the render authority for Markdown and section semantics.
  • Browser editors may consume metadata emitted by this path, but should write back to Markdown/front matter contracts.

layouts/partials/page

layouts/partials/page/chrome-contract.html

page/chrome-contract.html

Builds the page chrome contract consumed by page/chrome-render.html.

Inputs:

  • dict with Page: current Hugo page.

Output:

  • JSON object describing book TOC, heading TOC, video aside, summary aside, configured aside sections, overlay rendering, and related chrome labels.

Boundary:

  • This partial decides chrome capability and metadata only.
  • Visible header/aside/footer markup belongs in render partials.

layouts/partials/page/chrome-render.html

page/chrome-render.html

Renders the shared page chrome from a normalized chrome contract.

Inputs:

  • Page: current Hugo page.
  • Chrome: dict produced by page/chrome-contract.html.

Responsibilities:

  • renders header-related data attributes, logo/navigation hooks, aside toggles, page/book TOC surfaces, video/summary chrome, and overlay mount points.
  • keeps header behavior compatible with SPA replacement and shared runtime code.

Section Pipeline

layouts/partials/page/sections

layouts/partials/page/sections/content-contract.html

Content-wrapper attrs are only supported in the inline --- { ... } form. Standalone Goldmark attr lines must remain with their preceding block so blockquote/list/image attrs reach Hugo render hooks intact.

layouts/partials/page/sections/contract.html

page/sections/contract.html

Builds a normalized semantic/rendering contract for one authored section.

Inputs:

  • Root, Page, Index, Section: current render context and raw section source.
  • inherited style/class defaults and section margin parameters from main.html.

Output:

  • JSON object with section ids, class tokens, semantic axes, content/media block ids, section body, media metadata, style attributes, editor metadata, and compatibility fields.

Boundary:

  • This partial computes intent; render.html emits the final DOM.

layouts/partials/page/sections/index.html

page/sections/index.html

Top-level section rendering coordinator.

Inputs:

  • Root: root template context.
  • Page: current Hugo page.
  • section class defaults, class groups, conditional rules, margin/style params.

Responsibilities:

  • obtains source sections from source-sections.html;
  • builds one section contract per authored section with contract.html;
  • prepares editor metadata and inline figure numbering context;
  • delegates final DOM output to render.html;
  • writes the page-level editor data contract used by browser editing surfaces.

layouts/partials/page/sections/render.html

page/sections/render.html

Emits the final section DOM from a section contract.

Inputs:

  • section ids, class string, flow, media metadata, section body, style attrs, live editor metadata, and legacy partial compatibility fields.

Responsibilities:

  • renders the semantic section wrapper and content/media nodes;
  • preserves editor-facing data-ql-* identities;
  • routes section media through the shared media/figure pipeline;
  • keeps legacy section partials working while new section axes remain canonical.

layouts/partials/page/sections/source-sections.html

page/sections/source-sections.html

Returns the authored source sections for a page.

Behavior:

  • splits .RawContent on section separators (\n---\n);
  • optionally stitches bundled child page resources for page bundles;
  • caches the JSON result in page Store under ql:source-sections:v1.

Output:

  • JSON object: { "Sections": [] }.

Media

layouts/partials/media

layouts/partials/media/random-svg.html

each cell is 50x50

layouts/partials/media/render.html

partials/media/render.html Single entry point for all media. Accepts: dict{ “Destination”: string “Title”: string “Text”: string “Page”: .Page “Layout”: “left”|“right”|“fit” “NoLink”: bool “Image”: .Resource (optional) “ForceType”: string (optional; e.g. “iframe” to bypass file-extension detection) }

Notes:

layouts/partials/media/utils

layouts/partials/media/utils/find.html

partials/media/utils/find.html Find & classify a media destination.

Input: dict{ “Destination”: string “Page”: .Page (page object) } Returns dict: { “src”: string // usable src (rel URL if local) “rel”: string // relPermalink when local “ext”: string // extension incl. dot, lowercase “type”: string // one of: youtube,pdf,svg,html,model,image,image-external,video,video-external,external “resource”: any // Hugo resource (when local) “external”: bool // true if http(s) }

Rules for HEIC/HEIF:

  • If a JPEG/JPG sibling with the same basename exists in the bundle, return THAT resource and set ext to “.jpeg” (or “.jpg” per the resource subtype).
  • If no JPEG sibling resource exists, rewrite the src string to “.jpeg” (resource=false), so callers still emit an , but without Resize.

Head And Runtime

layouts/partials/head

No leading Hugo template comment docstrings found in this directory.

layouts/partials/head/import

layouts/partials/head/import/runtime-core.html

Critical runtime/editor imports. Keep these explicit and ordered. Site overrides should import this partial rather than hand-rolling core JS tags.

Views

layouts/partials/views

layouts/partials/views/latest.html

This partial is called by _default/list.html In the future, this could be called elsewhere, such as sidebar or home as a featured article @first: class attributes @right: class attributes @left: class attributes @summary: bool @authors: bool @date: bool @figure: bool @timeFormat: timeFormat @width: int @title: string

layouts/partials/views/summaries.html

summary.html partial documentation

This partial renders a list of page summaries, sorted by shared ordered-page logic, slug, or date.

Sorting: • ordered mode (default): uses shared ordered-pages logic: weight first, then front matter date, then file modification time. • slug mode: orders all pages by the base name of .RelPermalink. • date mode: - pages are sorted by Date descending.

Implementation: 1. Builds a slice of dicts: each dict contains: - Page: the Page object - Name: basename of .RelPermalink 2. Depending on .Params.Summaries.sort (“ordered”, “slug”, or “date”), computes the final $pages slice. 3. Loops over $pages, setting: - loading: “eager” for the first item, “lazy” for others. - class: CSS classes for first, even, odd items (using .Params.Summaries.first, .right, .left). 4. Merges global .Params.Summaries into each dict and invokes the “views/summary” partial.

Parameters (merged into $dict for partial “views/summary”): - Page *Page : The Hugo Page object being rendered. - class string : CSS classes for summary container. - loading string : Image loading attribute (“eager” or “lazy”). - first string : CSS classes for the first summary. - right string : CSS classes for summaries with even index (excluding first). - left string : CSS classes for summaries with odd index (excluding first). - summary bool : Show or hide summary text. - authors bool : Show or hide authors list. - date bool : Show or hide date. - figure bool : Wrap thumbnail in a

element. - timeFormat string : Go time.Format layout for displaying dates. - width int : Width in pixels for thumbnail images.

layouts/partials/views/summary.html

views/summary.html

Renders one summary card for a page in list/section output.

Inputs:

  • Page: page to summarize.
  • path: optional page path relative to the current page.
  • optional flags: summary, authors, date, figure, listChildren, childrenOpen, childrenTitle.
  • optional presentation keys: timeFormat, width, loading, class, title, bookIndex.

Summary source priority:

  1. front matter summary;
  2. front matter description;
  3. front matter abstract;
  4. Hugo .Summary;
  5. plain page text.

This priority keeps docs wrapper cards from exposing raw shortcode/JSON output when front matter already provides a concise description.