CLAUDE.md #

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Commands #

npm run watch      # Build, serve (with live reload), watch for changes, and run tests concurrently
npm run build # Full build (clean + JS bundle + eleventy + tests)
npm run serve # Clean + eleventy --serve (no JS watch)
npm run test # Run Mocha tests once
npm run test-watch # Watch and re-run tests on file changes
npm run js-build # Bundle JS with Rollup only
npm run clean # Remove _site/publications/*

npm run build is also triggered automatically on git push via a pre-push hook.

To run a single test file: npx mocha test/test-homepage.js

Architecture #

This is a French-language personal blog built with Eleventy (11ty) v3 as a fork of Google's eleventy-high-performance-blog.

Content #

Build pipeline #

  1. JS: Rollup bundles src/main.jsjs/min.js (with Terser minification and source map).
  2. Eleventy: Processes Markdown + Nunjucks templates. Main config in .eleventy.js.
  3. Images: Custom plugins in _11ty/ generate srcset, AVIF/WebP variants, blur-up placeholders, and convert GIFs to MP4. Remote images are cached locally in img/remote/.
  4. CSS: css/main.css (Bahunya framework) is inlined per-page and dead-code-eliminated with PurgeCSS.
  5. HTML: Aggressively minified.
  6. CSP: Hash-based Content Security Policy headers auto-generated from inlined scripts.
  7. Output: _site/

Key files #

FilePurpose
.eleventy.jsMain Eleventy config — collections, filters, plugins
_11ty/Custom plugins: image srcset, blur placeholders, JSON-LD, CSP, HTML optimization, GIF-to-video
_data/csp.jsCSP policy rules
_data/isdevelopment.jsSwitches dev vs. prod behavior (e.g., GA, minification)
rollup.config.jsJS bundler config
test/Mocha tests — homepage, generic post, draft handling

Collections & filters (.eleventy.js) #