Files
ericxliu-me/AGENTS.md
Eric Liu 79473f582a
All checks were successful
Hugo Publish CI / build-and-deploy (push) Successful in 16s
docs: add Hugo partials structure documentation
2025-12-20 20:41:56 -06:00

1.2 KiB

Hugo Partials Structure

This site uses the hugo-coder theme with the hugo-cloak-email plugin.

Partial Directories

layouts/partials/

Standard Hugo partial override directory. Files here override theme partials when called via partial "name.html".

Used for:

  • cloakemail.html — Overrides hugo-cloak-email's default partial
  • head.html — Adds font preloading and AdSense
  • footer.html — Custom footer with [commit] placeholder
  • home/social.html — Integrates cloakemail for email obfuscation
  • home/avatar.html — Custom avatar rendering

layouts/_partials/

Non-standard directory used by hugo-coder theme. Files here override theme partials when called via partial "_partials/name.html".

Used for:

  • csp.html — Custom Content Security Policy with additional script sources

How Hugo Resolves Partials

Hugo's lookup order tries user overrides first, then falls back to theme files:

  1. layouts/partials/ or layouts/_partials/ (your overrides)
  2. themes/<theme>/layouts/partials/ or themes/<theme>/layouts/_partials/

Verification

Run hugo --templateMetrics to see which templates are actually being used and their execution counts.