On this page
The short answerHow Eleventy changes the testing boundaryWhy Eleventy examples break or get tested wronglyBuild a small probeCompare source scanning with the published pageRender a scan-ready copyTriage findings in contextRun both checks in CIMake the check repeatableWhere DocsAlive fitsThe sources we checkedFAQThe short answer
Test Eleventy examples against what the published page actually shows. Eleventy can assemble a code block from data and includes before a reader sees it, while DocsAlive 0.6.3 does not detect Eleventy or render Liquid: it scans eligible source files as plain Markdown. In the verified probe, that difference produced a likely docs bug for an include-only block even though the published page was correct, scanned an ignored draft, and reported an unknown Liquid fence as passing without checking it. A render-for-scan copy narrows those gaps, but its limits need review.
A successful site build and a successful example run answer different questions. The build checks whether Eleventy can turn the project into pages. An example check asks whether the code a reader sees works in the environment and order the documentation describes. Both checks matter when source text is transformed before publication.
This guide uses a small Eleventy 3.1.8 project and the observed behavior of engine 0.6.3. The files are illustrative; the deliberately broken change is identified below. The commands show the verified workflow, but a real project should adapt the paths and rendering assumptions to its own configuration.
How Eleventy changes the testing boundary
Eleventy preprocesses Markdown as Liquid by default. The markdownTemplateEngine setting can select another engine, such as Nunjucks, or disable that preprocessing. A reader can therefore see code assembled from a data value and an included file even though neither appears as ordinary executable code in the source fence.
The default includes folder is _includes inside the input folder, and global data files belong in _data. Liquid include paths are quoted in the normal configuration; since Eleventy 1.0, unquoted paths require dynamicPartials to be false. Raw tags serve a different purpose: they preserve template syntax as literal content for a reader instead of letting the template processor interpret it.
Publication rules also affect the testing boundary. Eleventy supports .eleventyignore and programmatic ignore entries, automatically ignores paths in .gitignore, and always ignores node_modules. A source scanner that does not read those rules can report on a draft that the site never publishes. Conversely, a test that only runs an include file may miss the context in which the page presents it.
| Eleventy item | What Eleventy does | What the engine does in 0.6.3 |
|---|---|---|
| Markdown template engine | Preprocesses Markdown as Liquid by default; configuration can change or disable it | Does not detect Eleventy or render the selected template engine |
| Global data and includes | Makes global data available and can insert included content into a page | Reads source text; it does not assemble the reader-visible block |
| Raw tags and a Liquid fence | Can preserve a literal template example | Does not render the tags; the unknown Liquid fence reports pass without a check |
| Ignored draft | Excludes it when the configured ignore applies | Does not read Eleventy ignores and can scan the draft |
| Static file copy | Can copy static files through passthrough configuration | The probe did not use passthrough copy; do not infer coverage for it |
| Page selection | Builds according to the Eleventy project configuration | Uses plain-project collection rules and eligible Markdown suffixes |
The engine scans .md, .mdx, and .markdown pages. It does not treat an included .py file or a template file as a page. For a plain project with a top-level docs/ folder, its default collection covers that folder and adds a root README when present. An include filter can narrow collected pages; it cannot recover pages from folders that collection always skips.
Why Eleventy examples break or get tested wrongly
Most broken examples on Eleventy sites are not caused by Eleventy. They come from the same drift every documentation site has: a package renames a function, a command gains a required flag, or a version string moves forward while the code around it stays the same. Eleventy adds a second layer on top of that drift, because the code a reader copies can be assembled at build time from pieces that live in different files.
The first piece is global data. A version number, package name or base URL often lives in a file under _data so every page stays consistent. That is good practice, but it means the code block in the source file is not the code the reader receives. Change the data file and every example that interpolates it changes too, without any edit to the pages themselves. A review of the page diff shows nothing; only a check of the rendered code shows the effect.
The second piece is includes. Teams keep longer samples as real source files under _includes so they can be linted or run on their own, then pull them into a fenced block with an include tag. Testing the included file directly is useful, but it does not prove the page presents it correctly. The include can point at the wrong file, a renamed file can leave the page empty, or the surrounding prose can promise setup the file does not perform.
The third piece is publication status. Drafts, archived pages and work in progress often sit in the same input folder and are kept out of the site with ignore rules. A source scanner that does not read those rules reports on pages no reader can open, which adds noise to a report and can bury the findings that matter.
The fourth piece is template syntax shown on purpose. A page that teaches Liquid or Nunjucks needs raw tags so the example survives the build. If the raw tags are missing, Eleventy either renders the example away or fails the build, depending on whether the expression is valid. Finally, a project can switch the Markdown template engine to Nunjucks or turn preprocessing off, which changes what every one of these pieces means. Know which engine the project uses before you decide how to prepare a scan.
Build a small probe
Start by creating the illustrative project and installing Eleventy. The tested setup also configured the package as a module and added a build script.
npm init -y
npm install --save-dev @11ty/eleventy
The illustrative configuration below sets the input and output folders, explicitly selects the default Markdown template engine, and excludes the draft path. The ignore entry matters later because the source scanner does not consume it.
export default function (eleventyConfig) {
eleventyConfig.ignores.add("docs/drafts/**");
return {
dir: { input: "docs", includes: "_includes", data: "_data", output: "_site" },
markdownTemplateEngine: "liquid",
};
}
The illustrative global data file supplies the package name and version. The page will use the version inside a Python string, so the value that reaches the reader is significant to execution.
{
"version": "2.4.1",
"package": "acme-client"
}
The illustrative include is a complete Python source file. Eleventy inserts it into a fenced block on the page; the file itself is not a scanned Markdown page.
def connect(host, port=8080):
return f"{host}:{port}"
print(connect("localhost"))
This illustrative page combines front matter, global data, an include, and a literal Liquid example. Read the two Python fences as reader-facing examples after Eleventy has processed the page. The last fence demonstrates template syntax and is intentionally preserved as text.
---
title: Install
layout: false
---
# Install {{ site.package }}
Check the version you are about to install:
```python
version = tuple(int(part) for part in "{{ site.version }}".split("."))
assert version >= (2, 0, 0)
print(version)
```
Connect to a local server:
```python
{% include "snippets/connect.py" %}
```
A Liquid example shown to readers, kept literal with raw:
{% raw %}
```liquid
{{ page.title }}
```
{% endraw %}
The next illustrative file is deliberately unsuitable for the current Python runtime. It is a draft, however, and the configured site build excludes it. Its presence in the repository alone does not mean a reader receives it.
# Next release (draft)
```python
from collections import Mapping
```
Build the project to see what Eleventy publishes. A successful build establishes that the template processing completed; it does not by itself execute the Python shown on the resulting page.
npx @11ty/eleventy
The following is the recorded build output for this probe. The built page contained the concrete version in the first Python block, the full included source in the second, and the literal template example. No page was written for the ignored draft.
[11ty] Writing ./_site/install/index.html from ./docs/install.md (liquid)
[11ty] Wrote 1 file in 0.13 seconds (v3.1.8)
Compare source scanning with the published page
The following command plans a scan of the source. Without execution, a scan extracts and plans blocks; the findings discussed here are what occurred when the probe was run.
docsalive scan .
The source scan collected three pages and five blocks: the root README, the install page, and the ignored draft. The version block failed with a runtime error needing review because the unrendered template text reached Python. The include-only block failed as invalid syntax and was counted as a likely docs bug, even though the published page contained valid included Python. That is a false docs bug caused by the rendering gap.
The draft produced an API-drift finding although Eleventy excluded it. The Liquid-labeled fence passed without being run or parsed: unknown fence labels have no checker in 0.6.3, so a pass is a known coverage limitation. The README package-install block was skipped with network disabled. None of these results says that the scanner saw the same page a reader saw.
Only printed output in pycon sessions is compared. Separate output blocks are skipped; a green result for a different block should not be read as a comparison of displayed results. See documentation drift for the broader problem of examples changing independently of the page around them.
Render a scan-ready copy
The following illustrative script was verified for this probe. It renders page bodies with the Liquid library installed with Eleventy, reads the one global data file, resolves includes, skips three named directories, and writes a Markdown copy. Keep that copy out of the repository or regenerate it in CI so stale generated pages do not become the thing being tested.
// Render Liquid in docs/*.md the way the site shows it, then write plain Markdown to scan.
import { Liquid } from "liquidjs";
import fs from "node:fs";
import path from "node:path";
const [src = "docs", out = "scan-docs"] = process.argv.slice(2);
const skip = ["_includes", "_data", "drafts"];
const site = JSON.parse(fs.readFileSync(path.join(src, "_data", "site.json"), "utf8"));
const liquid = new Liquid({ root: [path.join(src, "_includes")], extname: "" });
let count = 0;
for (const rel of fs.readdirSync(src, { recursive: true })) {
if (!rel.endsWith(".md") || skip.some((dir) => rel.split(path.sep).includes(dir))) continue;
const text = fs.readFileSync(path.join(src, rel), "utf8");
const match = text.match(/^---\n[\s\S]*?\n---\n/);
const head = match ? match[0] : "";
const body = await liquid.parseAndRender(text.slice(head.length), { site });
fs.mkdirSync(path.dirname(path.join(out, rel)), { recursive: true });
fs.writeFileSync(path.join(out, rel), head + body);
count += 1;
}
console.log(`rendered ${count} page(s) into ${out}/`);
Generate the copy before planning or running its scan. In the verified run, the scanner collected the copied install page and the root README, for two pages total. Both Python blocks passed when run; the Liquid fence still passed without a check.
node scripts/render-for-scan.mjs docs scan-docs
docsalive scan . --docs-dir scan-docs
The script reported one copied page. The additional page in the scan was the root README automatically added for the plain project.
rendered 1 page(s) into scan-docs/
This deliberately broken data change illustrates why rendering matters. Eleventy still built successfully, but the rendered version block failed when run because the version contained a nonnumeric component. That is a failure a reader copying the rendered code would encounter.
- "version": "2.4.1",
+ "version": "2.x",
The script is a targeted adapter, not an Eleventy build. It loads only site.json, not every global data file, front matter variable, or computed value. It does not know custom filters or shortcodes from the Eleventy configuration. It uses Liquid library defaults rather than Eleventy’s exact Liquid options, handles Liquid only, and will not reproduce a Nunjucks configuration. Its skip list is hard-coded rather than read from Eleventy ignores. Compare representative copied pages with built pages whenever those assumptions change.
Triage findings in context
| Finding | Likely cause | What to do |
|---|---|---|
| Version code fails on template text | Source was scanned before data was rendered | Compare the built page and a rendered copy; run the concrete value |
| Include-only block is marked invalid syntax | The include tag was treated as Python | Verify the included file and scan a faithful rendered page |
| Draft produces API drift | The scanner did not read the site ignore rules | Decide whether the draft belongs in the release check and align the copy’s skip list |
| Liquid fence passes | Its label has no checker in 0.6.3 | Review the example separately; do not interpret the pass as validation |
| README install step is skipped | Network was disabled | Record the gap and use an appropriate network-enabled check when needed |
| A rendered example fails | The value or included code may be genuinely broken | Reproduce with the documented setup and decide whether the page needs a change |
Use finding categories to distinguish likely docs bugs from results that need review. A clean scan is meaningful only alongside the page list, skipped reasons, setup, and the transformation used to create the input.
Run both checks in CI
Treat the Eleventy build and the example check as two separate steps with separate meanings. The build step answers whether the site can be produced at all: missing includes, invalid template syntax and configuration errors stop it. The example step answers whether the code readers see actually works with the prerequisites the page states. One does not replace the other, and a pipeline that only builds the site will stay green while examples drift.
A practical order is to install dependencies, build the site, regenerate the scan-ready copy from the same checkout, and then scan the copy. Regenerating the copy in the same job matters: a copy committed weeks ago tests old data and old includes, which is exactly the drift you are trying to catch. Add the copy folder to the ignore rules of your version control so nobody edits it by hand.
Decide in advance which results block a merge. A reasonable starting point is to block on likely docs bugs found in the rendered copy and to report, but not block on, results that need review. Record the skipped blocks and the unknown fence labels in the job summary so reviewers can see what was not checked. When the scan of the raw source and the scan of the copy disagree, trust the copy only after comparing a few rendered pages with the built HTML; that comparison is what keeps the adapter honest. The GitHub Actions guide shows how to wire a scan into a workflow.
Make the check repeatable
Use this checklist in a review or CI plan. It records both the published-page boundary and the remaining gaps.
[ ] Build the Eleventy site with its intended configuration.
[ ] Identify the Markdown template engine and reader-visible data and includes.
[ ] Compare representative built pages with the scan-ready copy.
[ ] Match the copy's exclusions to the pages intended for publication.
[ ] Regenerate the copy before scanning and keep stale copies out of the repository.
[ ] Review the collected pages, skipped blocks, and unknown fence labels.
[ ] Reproduce likely docs bugs with the documented setup and concrete values.
[ ] Check template examples and unsupported behavior separately.
Where DocsAlive fits
DocsAlive fits after the page boundary is understood. It extracts fences, plans supported checks, runs examples in isolated per-page containers, and classifies findings so maintainers can focus on likely documentation defects. Its CLI reference describes scan controls, while the framework reference describes supported detection. Use Eleventy’s own build alongside it, and use a separately verified adapter when source and published examples differ.
On an Eleventy site, the realistic setup in 0.6.3 is the build for template errors, the rendered copy for the code readers see, and the scan with triage on top of that copy. Every plan runs the scan on a schedule, and the Team plan and above add pull request checks and draft fix pull requests; see pricing for what each plan includes. To see a real report on a public repository you maintain, send it through the health check.
For a broader workflow, see static-site documentation testing and the documentation testing checklist. Projects mixing generators may also need the distinct boundaries in Zola and Quarto.
The sources we checked
These sources were read on November 14, 2026. Engine behavior was checked against engine 0.6.3 on the same day.
| Source | What it covers |
|---|---|
| Eleventy Markdown | Markdown preprocessing |
| Eleventy Liquid | Liquid and include behavior |
| Eleventy configuration | Project configuration |
| Eleventy ignores | Ignored paths |
| Eleventy global data | Global data files |
| Eleventy passthrough copy | Static file copying |
| Python 3.10 changes | Removed compatibility aliases |
FAQ
Does DocsAlive understand Eleventy in 0.6.3?
No. It does not detect Eleventy and scans eligible files as plain Markdown without rendering Liquid. In the probe it counted an include-only block as a likely docs bug although the published page was correct, scanned an ignored draft, and reported an unknown Liquid fence as passing without a check.
Is a successful Eleventy build an example test?
No. It confirms that the site built, but the displayed code can still fail when a reader runs it. Test the concrete code the built page presents as well as the build.
Why did an ignored draft appear in the scan?
Engine 0.6.3 does not read Eleventy ignore rules. A draft can remain an eligible Markdown file in the repository even though Eleventy excludes it from publication.
Does the render-for-scan script reproduce every Eleventy project?
No. It handles the probe’s Liquid, one data file and a hard-coded skip list. It does not reproduce all data, custom template behavior, Eleventy Liquid options or another configured template engine.
What does a passing Liquid fence mean?
In engine 0.6.3 that unknown label is reported as passing without being run or parsed. Review the example with a suitable separate check.
What should maintainers do with a likely docs bug?
Reproduce it using the reader-visible code and documented setup. Check whether rendering, an ignored page, missing context or a real code change explains the result before editing the documentation.




