On this page
The short answerHow a Jekyll site holds examplesWhy Jekyll examples driftClassify the blocks before running themWhat the raw scan seesPrepare a scan-ready copyTriage findingsFit the checks into a release routineWhere DocsAlive fitsThe sources we checkedFAQThe short answer
Test the code Jekyll publishes, including code brought in by Liquid, and test Ruby plugins separately. In engine 0.6.3, DocsAlive treats a Jekyll repository as plain Markdown: it does not render Liquid before extracting fences. A scan-ready copy can make several common constructs visible to the engine, but it is a focused workaround, not a substitute for a Jekyll build or a complete Liquid renderer.
A documentation test should answer two questions: what does the reader see, and does that example work under the prerequisites on the page? For Jekyll, those questions can involve different files. A page can include a neighboring source file, interpolate a site setting, or generate a highlighted sample before Markdown is rendered. Testing only the page source can therefore test a different program from the one a reader copies.
The examples below use a small site built with Jekyll 4.4.1. They also show the observed behavior of engine 0.6.3 and a verified preparation script. The static-site testing guide covers the broader workflow; Antora and Fumadocs need different preparation because their source formats and rendering rules differ.
How a Jekyll site holds examples
A Jekyll repository can publish from a top-level docs/ folder on GitHub Pages. Its _config.yml controls site settings and Markdown processing. Pages with front matter are processed; a file without front matter is treated as a static file and copied to the output. A Markdown file may therefore exist in the repository and in _site without Jekyll rendering it as a page. See the Jekyll directory structure, static-file documentation, and GitHub Pages publishing-source documentation.
Code can appear in backtick or tilde fences, in a highlight tag, or in a file inserted through an include or include_relative tag. Liquid runs before Markdown, so a variable or included file can change the code that reaches the reader. Posts in _posts can contain examples too; an old release post may still be discoverable even when its commands no longer match current packages.
Start with this illustrative site-creation and build sequence. The build writes docs/_site.
gem install --no-document jekyll
jekyll new docs --blank
cd docs && jekyll build
The illustrative configuration selects kramdown with GFM input and provides a version value used by a page. See Jekyll Markdown configuration and kramdown syntax.
title: Example Docs
version: "2.4"
markdown: kramdown
kramdown:
input: GFM
The following illustrative page combines several forms. Its front matter makes it a processed page. The Python fence depends on a neighboring file; the shell fence depends on a site setting; the highlight tag produces code without a Markdown fence. The Ruby hook is an example to test with Ruby tooling.
---
layout: default
title: Getting started
---
# Getting started
Check the Python version first.
```bash
python3 --version
```
The settings example comes from a file next to this page.
```python
{% include_relative examples/settings.py %}
```
Print the docs version from the site settings.
```bash
echo "Docs for version {{ site.version }}"
```
The same idea with the Liquid highlight tag:
{% highlight python %}
total = sum([1, 2, 3])
print(total)
{% endhighlight %}
A quick check in the interpreter:
```pycon
>>> sum([1, 2, 3])
6
```
A plugin hook written in Ruby:
~~~ruby
Jekyll::Hooks.register :site, :post_write do |site|
puts "built #{site.pages.size} pages"
end
~~~
This illustrative neighboring file is the content inserted into the Python fence. Run the file directly as well as testing the rendered page: changing it can affect every page that includes it without changing those pages themselves.
import json
settings = {"retries": 3, "timeout": 10}
print(json.dumps(settings, sort_keys=True))
This illustrative Markdown file has no front matter. Jekyll copied it unchanged to _site; it did not process it as a page.
# Notes without front matter
```bash
echo "static file"
```
The distinction matters in review. A site build can succeed while an included example fails at runtime. Equally, an include may be valid after rendering even though its unrendered tag is invalid Python. A test needs to distinguish those cases before treating a failure as a documentation defect.
Why Jekyll examples drift
Most broken Jekyll examples were correct when they were written. They drift because the code a reader sees is assembled from several places, and the people who change those places are not always looking at the page.
Included files change without the page. An include_relative tag keeps a program in a neighboring file so it can be edited, linted or reused. That is a good habit, but it moves the example out of the page diff. A reviewer who changes settings.py sees a Python change, not the three pages that render it. If a function is renamed or an argument becomes required, every page that includes the file is now wrong, and none of those pages shows up in the pull request.
Site variables change what the reader copies. A version number or package name kept in _config.yml is convenient: one edit updates every command on the site. It also means that one edit can break every command on the site. A pinned version that no longer exists, a renamed package, or a value left blank after a configuration cleanup all change the rendered command while the page source stays the same.
Highlight-tag samples sit outside most checks. The highlight tag renders code with line numbers or other options, and authors sometimes prefer it for longer samples. A tool that reads Markdown fences does not see it at all, so those samples often go untested for years.
Posts keep old instructions alive. Release notes and tutorials in _posts are dated, but search engines and readers do not always treat them that way. A post that shows how to install an old version, or how to call an API that has since changed, can keep sending readers into failures long after the main documentation is fixed. Decide which posts promise current behavior and which are historical records, and label the historical ones.
Ruby plugin code changes with the toolchain. Hooks and generators run inside Jekyll on whatever Ruby the build uses. A sample hook in the docs can stop working after a Jekyll or Ruby upgrade even when every page still builds, because the sample itself is never loaded by the build.
None of these failures is visible from the page source alone. Testing a Jekyll site well means testing the rendered example and, separately, the files and settings that feed it.
Classify the blocks before running them
| Kind | Test and review approach |
|---|---|
| Runnable fences | Run supported complete examples in page order with documented setup. |
| Liquid-built blocks | Resolve the relevant includes and values, then verify that the copy matches the rendered page. |
| Highlight-tag blocks | Convert them to fences for this scan or test their source separately. |
| Ruby | Use Ruby and Jekyll tooling; the engine recognizes Ruby but skips it. |
| Configuration | Validate with the relevant parser and tool; syntax alone does not prove a setting is meaningful. |
| Output and fragments | Treat labeled output as a description to review and intentional fragments as incomplete examples. |
A page may use both kinds of fence, but indented code blocks are not extracted by engine 0.6.3. A language label the engine does not recognize can be reported as passing without execution or parsing. That is an engine limitation: inspect the plan and use a suitable independent test for any unsupported label.
What the raw scan sees
The following command is illustrative and plans a scan; it does not execute examples without the execution flag.
docsalive scan .
In the verified repository, DocsAlive selected the top-level docs/ folder automatically and added the root README. It found six pages and eight blocks. Those pages included the post and both copies of the static notes file: _site and _posts are not excluded by the folder rules.
When executed, the Python fence containing only the include_relative tag failed as invalid syntax. That was a false failure caused by testing unrendered source, and the category would count it as a likely docs bug. The shell fence containing the dotted site variable passed while executing the literal Liquid text, rather than the rendered version value. A simple undotted variable can be recognized as a placeholder; the dotted form in this probe was not. The highlight-tag sample was not extracted, and the tilde-fenced Ruby block was skipped.
| Jekyll construct | What Jekyll renders | What the engine does in 0.6.3 |
|---|---|---|
| Backtick or tilde fence | A highlighted code block, after Liquid processing | Extracts the fence from source; it does not first render Liquid. |
| Include or include_relative in a fence | The included content | Sees the tag as source text; the Python case above produced a false invalid-syntax failure. |
| Dotted site variable in a fence | The configured value | Runs the literal source text in the verified shell example. |
| Highlight tag | Highlighted code | Does not extract the tag as a fenced block. |
| Ruby fence | Displayed Ruby code | Skips it as not executable. |
| Post | A rendered post | Scans eligible Markdown in _posts. |
| Static Markdown without front matter | An unchanged copied file | Can scan both source and _site copy if both fall under the chosen folder. |
These results show why a green status needs a coverage review. Passing the literal variable text does not establish that the command a reader sees was tested. Conversely, a failure on an unrendered tag is evidence about the scan input, not necessarily about the published example.
Prepare a scan-ready copy
The following illustrative script was verified for this layout. It requires a YAML parser in the environment running the script. It fills the supported includes and site values, converts highlight tags to fences, and reports remaining Liquid inside code blocks.
"""Write a scan-ready Markdown copy of a Jekyll site.
Fills in the Liquid that a code block depends on: include_relative and
include tags, site.* variables from _config.yml, and highlight tags
(turned into fenced blocks). Files without front matter, _site and the
Jekyll support folders are left out. Anything Liquid left inside a code
block afterwards is reported, because the page would show it differently.
"""
import re
import sys
from pathlib import Path
import yaml
src = Path(sys.argv[1] if len(sys.argv) > 1 else "docs")
out = Path(sys.argv[2] if len(sys.argv) > 2 else "scan-docs")
site = yaml.safe_load((src / "_config.yml").read_text()) or {}
SKIP = {"_site", "_includes", "_layouts", "_sass", "_data", "vendor", "node_modules", out.name}
problems = 0
def fill(text, page):
def include(m):
base = page.parent if m.group(1) == "include_relative" else src / "_includes"
return (base / m.group(2)).read_text().rstrip("\n")
text = re.sub(r"\{%-?\s*(include_relative|include)\s+(\S+)\s*-?%\}", include, text)
text = re.sub(r"\{\{-?\s*site\.(\w+)\s*-?\}\}", lambda m: str(site.get(m.group(1), m.group(0))), text)
text = re.sub(r"\{%-?\s*highlight\s+(\w+)[^%]*%\}", r"```\1", text)
return re.sub(r"\{%-?\s*endhighlight\s*-?%\}", "```", text)
for page in sorted(src.rglob("*.md")):
rel = page.relative_to(src)
if set(rel.parts) & SKIP or not page.read_text().startswith("---"):
continue
text = fill(page.read_text(), page)
in_code = False
for n, line in enumerate(text.splitlines(), 1):
if line.lstrip().startswith(("```", "~~~")):
in_code = not in_code
elif in_code and re.search(r"\{\{|\{%", line):
print(f"{rel}:{n}: Liquid left in a code block: {line.strip()}")
problems += 1
dest = out / rel
dest.parent.mkdir(parents=True, exist_ok=True)
dest.write_text(text)
print(f"wrote {dest}")
sys.exit(1 if problems else 0)
Build first, then create the copy and plan its scan with the explicit docs directory:
cd docs && jekyll build && cd ..
python3 scripts/jekyll_scan_copy.py docs scan-docs
docsalive scan . --docs-dir scan-docs
The script produced the following file list in the verified run:
wrote scan-docs/_posts/2026-11-01-release-notes.md
wrote scan-docs/getting-started.md
wrote scan-docs/index.md
The copy yielded four scanned pages including the root README and seven blocks. When executed, its Python, shell and pycon blocks passed; Ruby remained skipped. The engine compares printed output only for Python pycon or python-repl sessions. Findings refer to lines in the copy, so trace each one back to its source page or included file before editing.
This next illustrative addition is broken on purpose for the preparation script: it uses a page variable that the script does not fill.
Print the page title:
```bash
echo "{{ page.title }}"
```
The script reported the unresolved value and exited with a failure status:
wrote scan-docs/_posts/2026-11-01-release-notes.md
getting-started.md:54: Liquid left in a code block: echo "{{ page.title }}"
wrote scan-docs/getting-started.md
wrote scan-docs/index.md
Treat that stop as a request to review coverage. The script is not a Liquid engine: it does not implement filters, loops, conditionals or plugin tags. It also deliberately leaves static files without front matter out of the copy. Test any such published material separately, and compare representative generated blocks with the built site. Remove or recreate stale generated copies as part of your own workflow so old files cannot be mistaken for current coverage.
Triage findings
| Finding | What to check next |
|---|---|
| Invalid syntax at an include tag | Determine whether the scan received raw Liquid; inspect the rendered page and the included file. |
| A passing command containing a site value | Verify that the value was substituted before testing. |
| Failure in an old post | Decide whether the post promises current commands or needs version context. |
| Ruby skipped | Run a Ruby-specific test and, for hooks, a representative Jekyll build. |
| Missing dependency or fixture | Compare the page’s stated prerequisites with the test setup. |
| Highlight sample absent | Add a separate test or use a reviewed scan-ready copy. |
A missing install step, missing fixture or dependency on context is not automatically the same as a broken API example. Review the page sequence and the intended reader environment. DocsAlive keeps supported Python blocks in page order, but a test that supplies undocumented setup can still hide a missing instruction.
Use this checklist in a change review:
[ ] Build the Jekyll site and inspect changed rendered examples.
[ ] Identify included files, site values, highlight tags and affected posts.
[ ] Create and review a fresh scan-ready copy; resolve reported Liquid.
[ ] Plan and execute supported blocks with the intended setup.
[ ] Trace copy line numbers back to source pages and included files.
[ ] Test Ruby plugins and hooks with Ruby tooling.
[ ] Test static files and unsupported constructs separately.
[ ] Review skipped blocks, prerequisites and findings before release.
Fit the checks into a release routine
A Jekyll site changes in small ways between releases, so the checks work best as a routine rather than a one-time audit. A practical order looks like this.
First, build the site from a clean checkout. A failed build tells you about Liquid errors, missing includes and configuration problems before anything else runs. In our test, misspelling the include_relative path made the build stop with a Liquid exception that named the missing file and the page, and the command exited with status 1, so a CI job fails on it without extra work.
Second, regenerate the scan-ready copy from that same checkout and read the script's report. Unresolved Liquid inside a code block is a coverage gap, not a pass. Either extend the preparation for that construct, convert the sample to a form the copy supports, or record the page as tested another way.
Third, plan the scan before executing it. The plan lists what will run, what will be syntax-checked and what will be skipped, with a reason for each skip. Read the skips: Ruby, unknown labels and blocks without a language are where coverage quietly disappears. Then execute the supported blocks with the setup the pages document, not extra setup that a reader would not have.
Fourth, run the included files and plugin samples directly. A Python file that several pages include deserves its own test, because a fix to that file fixes every page at once. A sample hook should be loaded by a representative Jekyll build on the Ruby version you support.
Finally, look at a few rendered pages next to the copy. The script fills site values from _config.yml, but a theme, plugin or environment-specific configuration file can change the result. Spot checks catch differences that no scan reports.
When a finding appears, fix the source, not the copy. The copy is regenerated on every run, so edits there disappear; the page, the included file or the configuration value is the thing to change. The docs testing checklist has a release-level version of this routine, and the GitHub Actions guide covers running the steps in CI.
Eleventy also pre-processes Markdown with Liquid by default, so the same source-versus-rendered gap applies there; see testing Eleventy documentation examples. Hexo, a Node blog generator, inserts code through tag plugins and keeps drafts in the source tree; see testing Hexo documentation examples.
Where DocsAlive fits
Use DocsAlive on a reviewed Markdown copy to run supported examples and sort findings by their cause. Its page-level sandbox and ordered execution help reveal errors without treating every environmental failure as a docs bug. The CLI reference describes execution and setup options, and findings explains categories.
Keep the Jekyll build and Ruby tests in the workflow. A scan does not prove that navigation, layout or prose is correct, and the preparation script covers only the constructs stated above. For a public repository you maintain, the one-off health check can provide a report on up to 40 docs pages. Plans and limits are on the pricing page; the Open source plan is $0 per month for a public OSI-licensed repository.
The sources we checked
These sources were read on November 13, 2026. Engine behavior was checked against engine 0.6.3 on the same day.
| Source | What it covers |
|---|---|
| Jekyll directory structure | Site files and folders |
| Jekyll includes | Included content and relative includes |
| Jekyll Liquid tags | Highlighting and other tags |
| Jekyll Markdown configuration | Markdown processing settings |
| Jekyll static files | Files without front matter |
| Jekyll posts | Post organization |
| kramdown syntax | Fences, indented code blocks and attribute lists |
| GitHub Pages publishing sources | Publishing from a repository folder |
FAQ
Does a Jekyll build test every example?
No. A build checks site generation, but a rendered command or included program can still fail when a reader runs it.
Does DocsAlive render Liquid?
Engine 0.6.3 scans Jekyll as plain Markdown and does not render Liquid before extraction. The preparation script in this guide handles a limited set of constructs.
Why did an include produce invalid syntax?
The raw fence contained a Liquid tag rather than Python. Jekyll replaces that tag during its build, so inspect the rendered content before treating the raw-scan failure as a docs bug.
Are posts and generated files scanned?
Eligible Markdown in both _posts and _site can be scanned. In the verified repository a static notes file appeared twice, once in the source and once in the generated copy.
Does the engine run Ruby hooks?
No. Ruby fences are skipped in engine 0.6.3. Test plugins and hooks with Ruby tooling and a representative Jekyll build.
Does a passing scan cover all Liquid?
No. Review unresolved constructs, skipped blocks and the generated copy. The script does not implement filters, loops, conditionals or plugin tags.




