Eleventy Integration
Nunjucks templates and partials for building Eleventy sites with Vanilla Breeze.
Overview
The Eleventy integration provides Nunjucks templates, partials, and a starter configuration for 11ty projects. All templates follow Vanilla Breeze conventions.
Location: /integrations/eleventy/
Installation
Copy the integration files into your Eleventy project:
Directory Structure
Data Files
site.json
Site metadata available as site.* in templates:
navigation.json
Navigation structure for menus:
Partials
base.njk
Base HTML template with block inheritance:
Available blocks:
head- Additional head contentheader- Page headercontent- Main contentfooter- Page footerscripts- Additional scripts
nav-tree.njk
Tree navigation with collapsible sections:
Automatically highlights current page and opens ancestor sections.
page-toc.njk
Table of contents (requires toc data from plugin):
theme-toggle.njk
Theme switcher button:
Layouts
page.njk
Basic page layout with centered content:
docs.njk
Documentation layout with sidebar and TOC:
blog.njk
Blog post layout with metadata:
Shortcodes
The starter config includes these shortcodes:
codeBlock
browserWindow
icon
Filters
| Filter | Description | Example |
|---|---|---|
dateFormat |
Format date as "January 15, 2024" | {{ date | dateFormat }} |
dateToISO |
Convert to ISO 8601 string | {{ date | dateToISO }} |
slugify |
Convert string to URL slug | {{ tag | slugify }} |
startsWith |
Check if string starts with prefix | {% if url | startsWith("/docs/") %} |
Collections
The starter config provides these collections:
posts- Blog posts sorted by date (newest first)tagList- All unique tags from posts
Styles
Import vb-eleventy.css for 11ty-specific styles:
- Pagination styling
- Tag list patterns
- Post list layouts
- Collection navigation (prev/next)
- Prism.js syntax highlighting
- Markdown content styling