# Use layout for my includes

**URL:** <https://talk.jekyllrb.com/t/use-layout-for-my-includes/3400>\
**Category:** Help\
**Created:** [September 26, 2019, 3:22pm UTC](https://talk.jekyllrb.com/t/use-layout-for-my-includes/3400 "2019-09-26T15:22:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [September 26, 2019, 4:59pm UTC](https://talk.jekyllrb.com/t/use-layout-for-my-includes/3400/2 "2019-09-26T16:59:04Z")

</div>

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**

```auto
---
---

<html>
  <head>...</head>
  <body>
    {{ content }}
  </body>
</html>

```

**\_layouts/child.html**

```auto
---
layout: default
---

<div class="main">
  {{ content }}
</div>

```

Then in your pages you’d do something like

**page.md**

```auto
---
title: My page
layout: child
---

Some page content

```

Which would give you final HTML of:

```auto
<html>
  <head>...</head>
  <body>
    <div class="main">
      <p>Some page content</p>
    </div>
  </body>
</html>

```

---

_[View the full topic](https://talk.jekyllrb.com/t/use-layout-for-my-includes/3400)._
