Layouts

Layouts are templates in the _layouts directory that contain the common formatting for your pages. They are compiled as liquid templates (see reference). See what variables are avaialble.

Reusing Formatting

While different pages might need different layouts, there is generally some shared formatting, like menus. You can use the include Liquid tag to pull in shared formatting from the _includes directory.

Example layout:

<!DOCTYPE html>
<html>
  <head>
    {% include "head.liquid" %}
  </head>
  <body>
    <header>
      {% include "header.liquid" %}
    </header>
    <main>
      {{ page.content }}
    </main>
    <footer>
      {% include "footer.liquid" %}
    </footer>
  </body>
</html>