# Layout: default

**URL:** <https://talk.jekyllrb.com/t/layout-default/3591>\
**Category:** Uncategorized\
**Created:** [November 13, 2019, 7:57pm UTC](https://talk.jekyllrb.com/t/layout-default/3591 "2019-11-13T19:57:15Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![mmistakes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/mmistakes/32/2169_2.png) [@mmistakes](https://talk.jekyllrb.com/u/mmistakes)\
**Post date:** [November 14, 2019, 8:28pm UTC](https://talk.jekyllrb.com/t/layout-default/3591/7 "2019-11-14T20:28:07Z")

</div>

Here’s an example of how to chain layouts. As @rdyar mentioned, it all comes down to preference and how much you want to repeat yourself.

> [@Use layout for my includes](https://talk.jekyllrb.com/t/use-layout-for-my-includes/3400/2):
>
> You can chain layouts. A common convention is to have something like \_layouts/default.html which has all the common page wrapper elements you need, \<html\>, \<head\>, \<body\>, etc. Then you have child layouts that call the default layout but build on it. To do that you have to make use of the {{ content }} tag. A simple example would look something like: \_layouts/default.html --- --- \<html\> \<head\>...\</head\> \<body\> {{ content }} \</body\> \</html\> \_layouts/child.html --- layout: default …

If you chain the layouts you can have a `default.html` layout that has header, footer, etc. includes. Then you can build child layouts that reference that, where you may have subtle differences in the main part of the layout.

This is nice because then you’re not doing

```auto
{% include header.html %}
{% include footer.html %}

```

In each of your layouts. Those includes happen in `default.html` which cascades down to any child layouts the reference it. It’s less code, less repeating yourself, and less chance for errors.

---

_[View the full topic](https://talk.jekyllrb.com/t/layout-default/3591)._
