docs: add Hugo partials structure documentation
All checks were successful
Hugo Publish CI / build-and-deploy (push) Successful in 16s
All checks were successful
Hugo Publish CI / build-and-deploy (push) Successful in 16s
This commit is contained in:
32
AGENTS.md
Normal file
32
AGENTS.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# 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.
|
||||
Reference in New Issue
Block a user