components
includes
jekyll
templates
Include Components
The Zer0-Mistakes theme includes 70+ reusable components organized by category.
Overview
_includes/
├── analytics/ # Analytics integrations
├── components/ # UI components
├── content/ # Content rendering
├── core/ # Core layout elements
├── docs/ # Documentation specific
├── landing/ # Landing page components
├── navigation/ # Navigation elements
└── stats/ # Statistics dashboard
Using Includes
Basic Usage
{% raw %} {% include navigation/navbar.html %}{% endraw %}
With Parameters
{% raw %} {% include components/post-card.html post=post %}{% endraw %}
Conditional Include
{% raw %} {% if page.toc %}
{% include content/toc.html %}
{% endif %}{% endraw %}
Analytics Includes
Include
Purpose
analytics/google-analytics.html
Google Analytics 4
analytics/google-tag-manager-head.html
GTM head script
analytics/google-tag-manager-body.html
GTM body noscript
analytics/posthog.html
PostHog analytics
Usage
{% raw %} {% include analytics/posthog.html %}{% endraw %}
Component Includes
Include
Purpose
components/author-card.html
Author information card
components/cookie-consent.html
GDPR cookie banner
components/mermaid.html
Mermaid diagram loader
components/post-card.html
Blog post card
components/preview-image.html
Preview image handler
components/background-image.html
Cover art as a CSS background, with role="img" + aria-label or aria-hidden
components/search-modal.html
Search modal
components/searchbar.html
Deprecated Algolia-style search stub (use search-modal.html)
components/theme-info.html
Theme version modal
Post Card Example
{% raw %} {% for post in site.posts limit: 3 %}
{% include components/post-card.html post=post %}
{% endfor %}{% endraw %}
Author Card
{% raw %} {% include components/author-card.html
name=page.author
avatar="/assets/images/avatar.png"
%}{% endraw %}
Content Includes
Include
Purpose
content/comments.html
Comment section: the gate, heading, and giscus widget
content/giscus.html
GitHub Discussions comments widget
content/intro.html
Page introduction
content/seo.html
SEO meta tags
content/sitemap.html
Sitemap entry
content/toc.html
Table of contents
TOC Include
{% raw %} {% if page.toc != false %}
{% include content/toc.html %}
{% endif %}{% endraw %}
{% raw %} {% include content/comments.html %}{% endraw %}
One line renders the whole comment section, and only when site.giscus.enabled is true and the page has not set comments: false. Pass default_on=false to show comments only on pages that set comments: true. See Giscus Comments for the other parameters and the widget's config keys.
Core Includes
Include
Purpose
core/branding.html
Site logo and title
core/footer.html
Page footer
core/head.html
HTML head section
core/header.html
Page header/navbar
Layout Usage
{% raw %}<!DOCTYPE html>
< html >
< head >
{% include core/head.html %}
</ head >
< body >
{% include core/header.html %}
{{ content }}
{% include core/footer.html %}
</ body >
</ html > {% endraw %}
Navigation Includes
Include
Purpose
navigation/breadcrumbs.html
Breadcrumb trail
navigation/nav_list.html
Navigation list
navigation/nav-tree.html
Tree navigation
navigation/navbar.html
Main navbar
navigation/sidebar-config.html
Resolves the effective sidebar mode/title/icon (page → collection → site)
navigation/sidebar-nav.html
Renders the resolved sidebar mode
navigation/sidebar-categories.html
Categories/tags sidebar (posts by taxonomy term)
navigation/sidebar-folders.html
Collection sidebar (collapsible folder tree)
navigation/sidebar-left.html
Left sidebar panel
navigation/sidebar-right.html
Right sidebar (TOC)
The sidebar mode comes from the sidebar.nav front matter key (or a collection/site default), not an include parameter:
sidebar :
nav : docs # auto | collection | categories | tags | <_data/navigation file>
{% raw %} {% include navigation/sidebar-left.html %}{% endraw %}
See Sidebar Navigation for the full mode and option reference.
Landing Page Includes
Include
Purpose
landing/landing-install-cards.html
Installation options
landing/landing-quick-links.html
Quick action links
Usage
{% raw %} {% include landing/landing-install-cards.html %}{% endraw %}
Stats Includes
Include
Purpose
stats/stats-categories.html
Category statistics
stats/stats-header.html
Stats page header
stats/stats-metrics.html
Metrics display
stats/stats-no-data.html
Empty state
stats/stats-overview.html
Overview cards
stats/stats-tags.html
Tag cloud
Creating Custom Includes
Basic Include
<!-- _includes/components/custom.html -->
< div class = "custom-component" >
< h3 > {{ include.title }}</ h3 >
< p > {{ include.content }}</ p >
</ div >
With Parameters
{% raw %} {% include components/custom.html
title="My Title"
content="My content"
%}{% endraw %}
With Default Values
{% raw %}{% assign title = include.title | default: "Default Title" %}
< h3 > {{ title }}</ h3 > {% endraw %}
Conditional Content
{% raw %}{% if include.show_icon %}
< i class = "bi bi-{{ include.icon }}" ></ i >
{% endif %}{% endraw %}
Best Practices
Parameter Documentation
Add comments at the top of includes:
{% raw %}<!--
Include: post-card.html
Parameters:
- post (required): Post object
- show_excerpt (optional): Show excerpt, default true
- show_date (optional): Show date, default true
--> {% endraw %}
Error Handling
{% raw %} {% if include.post %}
<!-- render post card -->
{% else %}
<!-- error: post required -->
{% endif %}{% endraw %}
Avoid nested loops in includes
Use captures for complex logic
Cache expensive operations
Overriding Theme Includes
Copy and Modify
Copy include from theme to your _includes/
Modify as needed
Jekyll uses your version
Check Theme Location
bundle show jekyll-theme-zer0
# Copy includes from gem location
Troubleshooting
Include Not Found
Check file path is correct
Verify file exists
Check for typos in filename
Parameter Not Working
Verify parameter name matches
Check for required parameters
Debug with {{ include | inspect }}
Infinite Loop
Check for circular includes
Add guards for recursion
Use depth limiting
Technical Reference
For contributor-level details (component API reference, include parameters, extending the component library):
See also