Single-Source Accessible Publishing with Eleventy
Compiling one Markdown source into visual Bento HTML, zero-JS accessible pages, llms.txt companions, and Standard.site records under strict CSP.
Published: 2026-12-06
Every content page on this site is authored once in Markdown and compiled into four synchronized representations.
One Markdown or JSON source under src/ is compiled by Eleventy into four outputs: visual index.html in _site/, zero-JS accessible.html in _site/, machine-readable index.html.md in _site/, and .cache/standard-site-manifest.json outside _site/.
Single-source build outputs from src/.
Why Class-Based Highlighting Matters
Our Content Security Policy forbids unsafe-inline styles (style-src 'self'). Highlighters that emit inline style="..." attributes fail that check, so code blocks are highlighted at build time with highlight.js using semantic CSS classes:
const highlighted = hljs.highlight(source, { language: 'js' }).value;
return `<pre class="code-block"><code class="hljs language-js">${highlighted}</code></pre>`;
All colors live in external CSS using light-dark() tokens:
.hljs-keyword {
color: light-dark(#8b2635, #ff9e8a);
}
Accessible Inline SVGs
Because img-src 'none' blocks external image fetches, diagrams are inlined as SVG with <title> and <desc> required at build time. The zero-JS accessible.html build replaces each visual diagram with its title and description as plain prose.