ページを部品に分解する Partial と BlockTemplate について。
PartialTemplate
Partial templates
Partials are smaller, context-aware components in your list and page templates that can be used economically to keep your templating DRY.
https://gohugo.io/templates/partials/
layouts/_default/single.html
のように一部を部品で置き換える。
layouts/partials/head.html layouts/partials/header.html layouts/partials/footer.html
BlockTemplate
Base templates and blocks
The base and block constructs allow you to define the outer shell of your master templates (i.e., the chrome of the page).
https://gohugo.io/templates/blocks/
layouts/_default/single.html
のように自分が部品になる。 デフォルトでブロックテンプレート_default/baseof.html が選択される。
Partial よりも BlockTemplate の方がきれいに分割できる気がするね。実際には両方使う。