Using different layouts/partials for the home page and other pages


I’m trying to use Hugo to recreate my portfolio website (I have experience with Jekyll), but I’m really confused about the whole layout/partial thing.

What I’d like to have is:

  • an home page with its own header (but some of the header HTML will be the same, and I’d rather not copy-paste it from the default header)
  • some static pages with the default header
  • blog articles, with the default header as well

All this, in the most DRY way possible. I spent hours looking at existing site templates and themes, but I still don’t know how they achieve this (or if they even do achieve this).

Not sure if this will really help you, but my theme might have some features you’re looking for and it’s annotated in parts to explain what’s going on. If you have specific questions about it that might help you get to where you want to go, feel free to ask.

Download several Hugo themes and see how they are arranged inside.