Hugo Theme Engine: `{{ .render }} ` vs `{{ partial }}`

  • Render is for content pages only – and it renders a view with a template selected like https://gohugo.io/templates/views#which-template-will-be-rendered
  • partial is a workhorse that can be used everywhere to render a specific template – typically used for footers, headers, menus etc. Stuff that is the same for every (or most) pages.

The template selection in .Render makes it extremely flexible – you can have a summary.html template in _default used for most pages, but overridden for a specific content type and similar.

1 Like