Skip to main content
Settings
Color Mode
Theme Skin
Background

Appearance preferences are saved in this browser only.

Environment
Current Environment Production

Built with JEKYLL_ENV=production. Changes require deployment.

Quick Links
Theme & Build
Theme
jekyll-theme-zer0 Local
Jekyll v4.4.1
Last Build Oct 18, 02:18
Page Location
Page Info
Layout default
Collection docs
Path _docs/customization/layouts.md
URL /docs/customization/layouts/
Date 2026-10-18
Source Code

Set repository: USER/REPO in your _config.yml to enable source-code shortcuts.

Layouts

Layouts define the structure and appearance of your pages. The Zer0-Mistakes theme includes several built-in layouts.

Available Layouts

Layout Purpose Use Case
default Standard page with sidebar Documentation, general pages
journals Blog post layout Blog posts with metadata
home Homepage layout Site homepage
collection Collection index Listing pages for collections
landing Full-width page Marketing/landing pages
root Base HTML Don’t use directly

Using Layouts

Specify a layout in your page’s front matter:

---
title: "My Page"
layout: default
---

Layout Hierarchy

Layouts inherit from each other:

root.html
└── default.html
    ├── home.html
    ├── journals.html
    ├── collection.html
    └── landing.html

Creating Custom Layouts

Step 1: Create the Layout File

Create a file in _layouts/:

---
layout: default
---
<!-- _layouts/tutorial.html -->
<article class="tutorial">
  <header class="tutorial-header">
    <h1>{{ page.title }}</h1>
    <div class="meta">
      <span class="difficulty">{{ page.difficulty }}</span>
      <span class="time">{{ page.estimated_time }}</span>
    </div>
  </header>
  
  <div class="tutorial-content">
    {{ content }}
  </div>
  
  {% if page.next_tutorial %}
  <footer class="tutorial-footer">
    <a href="{{ page.next_tutorial }}">Next Tutorial →</a>
  </footer>
  {% endif %}
</article>

Step 2: Use the Layout

---
title: "Getting Started Tutorial"
layout: tutorial
difficulty: beginner
estimated_reading_time: "15 minutes"
next_tutorial: /tutorials/part-2/
---

Layout Variables

Access these variables in your layouts:

Variable Description
{{ content }} Page content (required)
{{ page.title }} Page title
{{ page.description }} Page description
{{ page.layout }} Current layout name
{{ page.url }} Page URL
{{ site.title }} Site title

Overriding Theme Layouts

To customize a theme layout:

  1. Copy the layout from the theme to your _layouts/ directory
  2. Modify as needed
  3. Jekyll uses your version instead

Conditional Content

Show content based on layout or page variables:

{% if page.layout == 'journals' %}
  <div class="post-meta">
    <time>{{ page.date | date: "%B %d, %Y" }}</time>
    <span class="author">{{ page.author }}</span>
  </div>
{% endif %}

{% if page.sidebar %}
  {% include navigation/sidebar.html %}
{% endif %}

Including Components

Use includes for reusable parts:

{% include core/head.html %}
{% include navigation/header.html %}
{% include content/toc.html %}
{% include core/footer.html %}

Best Practices

  1. Start with default — Inherit from default for consistency
  2. Keep layouts focused — Each layout should have one purpose
  3. Use includes — Extract reusable components
  4. Document custom layouts — Note purpose and required variables
  5. Test responsiveness — Verify layouts work on all screen sizes

Reference

Technical Reference

For contributor-level details (layout hierarchy, Liquid template inheritance, sidebar wiring):

See also