How to have a unique part in a layout?

I have a contact page ( and an about page ( I want them to have the same header and footer but not the same “main” element because this element will have different structure and styles.

Instead of creating a separate layout for each, how would I go about having a shared layout and “insert” the contents in the middle?


Have a read about base templates here:

How do I tie it all together?

I have layouts/page/baseof.html


Frontmatter contains type: page.

I defined blocks in layout/partials/about.html and layout/partials/contact.html

I want baseof.html to get the blocks from these files somehow. How to achieve this?

My two cent is create baseof.html in layouts/_default then add the the layout for custom type inside layouts/page/

contact.html #layout for contact page
about.html #layout for about page

define all the block then use different main section for each layout.

the last step add type and layout in front matter of each page content.

type: page
layout: your_layout

This is what I ended up doing