Partials are reusable template fragments you include from layouts.

In this project, partials live in layouts/_partials/ (for example header/, head/, main/, and sidebar/).

Use a partial

Call a partial from a layout and pass the current page context:

{{ partial "sidebar/section-menu.html" . }}

You can also pass a custom dictionary when a partial needs specific values:

{{ partial "inline-svg" (dict "src" "file-text" "class" "text-muted") }}

Create a partial

Add a file to layouts/_partials/, then include it from home.html, list.html, single.html, or another partial.

Use partials for repeated UI blocks and shared rendering logic. Keep them small and focused.

Learn more

Hugo
Partials

Build reusable template fragments.

Hugo
Partial caching

Use partialCached for expensive partials.