Eleventy Tricks

Table of Contents


This page follows a similar structure to /docs/projects

Getting Started Tricks

Not sure where to begin? Start with a minimal template:

Best Minimal Starters as of Feb 2026

Repo Stats
npm Dependencies Custom CSS
Custom JS
Custom Templates
CMS Included?
/anydigital/sveleven

~10 ~30 lines ♻️ uses Tailwind+Typography & Anybricks 0 ♻️ uses 11ty Bricks ~15 lines ♻️ uses Anybricks Sveltia CMS
/11ty/eleventy-base-blog

~10 ~300 lines ~200 lines ~200 lines
/MWDelaney/zeropoint

~15 ~200 lines ~300 lines ~250 lines not included, but documented
Not up-to-date:
/danurbanowicz/eleventy-sveltia-cms-starter

~10 ~150 lines ~130 lines ~250 lines Sveltia CMS
Not so minimal:
/scottsweb/elva

~25 ⚠️ ~1000 lines ⚠️ ~30 files ⚠️ ~20 files Front Matter CMS (local use only)
/madrilene/eleventy-excellent

~40 ⚠️ ~40 files ⚠️ Tailwind config for CUBE CSS ~40 files ⚠️ ~40 files ⚠️
/adamstddrd/grease

~5 ♻️ ~25 files ⚠️ ~15 files ~15 files
/nhoizey/pack11ty

~15 ~30 files ⚠️ ~10 files ~10 files

Command Line Tricks

Find and kill 11ty processes

ps aux | grep eleventy
pkill -f eleventy

You can even combine it with other processes hanging around:

ps aux | grep -E 'eleventy|tailwind|.bin/serve'
pkill -f tailwind
pkill -f .bin/serve

🥷 Reusable 11ty npm scripts via npm workspace
from /anydigital/eleventy-bricks

This package provides a pre-configured do folder setup that helps organize your development workflow using npm workspaces. The do folder contains scripts for building and running your Eleventy project.

Installation:

  1. Install /anydigital/eleventy-bricks to reuse pre-defined 11ty scripts from there:
npm install @anydigital/eleventy-bricks
  1. Create a helper folder do to symlink the do/package.json within:
mkdir do
cd ./do
ln -s ../node_modules/@anydigital/eleventy-bricks/src/do/package.json
  1. Finally register do folder as npm workspace in your root package.json:
{
  ...
  "workspaces": ["do"],
  "scripts": {
    "start": "npm -w do run start",
    "stage": "npm -w do run stage",
    "build": "npm -w do run build"
  },
  ...
}

Done! 🎉 Now you can run:

Living example: /anydigital/sveleven

Benefits:


Configuration Tricks

🥷 Symlinked eleventy.config.js
from /anydigital/eleventy-bricks

The package includes a fully-configured Eleventy config file eleventy.config.js that you can symlink to your project to get:

Benefits of symlinking:

Installation as simple as:

npm install @anydigital/eleventy-bricks
ln -s ./node_modules/@anydigital/eleventy-bricks/src/eleventy.config.js

Data & Processing Tricks

Global siteData helper

🧩 Install via Plugin — or copy-paste from src/siteData.js

Adds global site data to your Eleventy project, providing commonly needed values that can be accessed in all templates:

Variable Value
{{ site.year }} The current year as a number (e.g., 2026)
{{ site.prod }} Boolean indicating if running in production mode (true for eleventy build, false for eleventy serve)

🥷 autoLinkFavicons transformer

🧩 Install via Plugin — or copy-paste from src/processors/autoLinkFavicons.js

Automatically adds favicon images from Google's favicon service to links that display plain URLs or domain names. This processor processes all HTML output files and adds inline favicon images next to link text that appears to be a plain URL.

Why use this? When you have links in your content that display raw URLs or domain names (like https://example.com/page), adding favicons provides a visual indicator of the external site. This processor automatically detects these plain-text URL links and enhances them with favicon images, making them more visually appealing and easier to recognize.

How it works:

  1. Scans all HTML output files for <a> tags
  2. Checks if the link text appears to be a plain URL or domain
  3. Extracts the domain from the URL
  4. Removes the domain from the link text (keeping only the path)
  5. Adds a favicon image from Google's favicon service inline with the remaining text

Example:

Before processing:

<a href="https://github.com/anydigital/eleventy-bricks">https://github.com/anydigital/eleventy-bricks</a>

After processing:

<a href="https://github.com/anydigital/eleventy-bricks" class="whitespace-nowrap" target="_blank">
  <i><img src="https://www.google.com/s2/favicons?domain=github.com&sz=32" /></i>
  <span>/anydigital/eleventy-bricks</span>
</a>

Rules:

mdAutoRawTags preprocessor

🧩 Install via Plugin — or copy-paste from src/processors/markdown.js

Prevents Nunjucks syntax from being processed in Markdown files by automatically wrapping {{, }}, {%, and %} with {% raw %} tags.

Why use this? When writing documentation or tutorials about templating in Markdown files, you often want to show Nunjucks/Liquid syntax as literal text. This preprocessor automatically escapes these special characters so they display as-is instead of being processed by the template engine.

Example:

Before mdAutoRawTags, writing this in Markdown:

### Using {{ variable }} to output variables

Would try to process {{ variable }} as a template variable. With mdAutoRawTags, it displays exactly as written.

mdAutoNl2br converter

🧩 Install via Plugin — or copy-paste from src/processors/markdown.js

Automatically converts \n sequences to <br> tags in Markdown content. This is particularly useful for adding line breaks inside Markdown tables where standard newlines don't work.

Why use this? Markdown tables don't support multi-line content in cells. By using \n in your content, this preprocessor will convert it to <br> tags, allowing you to display line breaks within table cells and other content.

Example:

In your Markdown file:

| Column 1               | Column 2                          |
| ---------------------- | --------------------------------- |
| Line 1\nLine 2\nLine 3 | Another cell\nWith multiple lines |

Will render as:

<td>Line 1<br />Line 2<br />Line 3</td>
<td>Another cell<br />With multiple lines</td>

Note: This processes literal \n sequences (backslash followed by 'n'), not actual newline characters. Type \n in your source files where you want line breaks.


Templating Tricks

Nunjucks & Liquid Tricks →

/tricks/njk-liquid

Awesome 11ty List


Featured in: