Super-Simple Includes Documentation

v0.244.0

Examples

Example Sites

Super-Simple Includes comes with example sites numbered 1–25 and 99. Each example builds on the previous ones, introducing new concepts progressively from absolute basics to production-ready patterns.

Example Overview

All examples are in the examples/ directory of the repository.

#ExampleWhat It TeachesLive
1copy-onlyMinimal config — only required fields, default processing = "copy"View live
2simple-pageFirst template processing — processing = "page" with plain-text includesView live
3markdown-contentMarkdown conversion — type = "markdown" for content filesView live
4assets-with-checksumsChecksum verification — options = ["checksum"] and .xxh3 filesView live
5content-typesAuto-detection — type = "auto" for mixed-format directoriesView live
6html-blocksHTML components — reusable blocks with type = "html"View live
7toml-dataStructured data — TOML files as variable sourcesView live
8step-orderStep ordering — pipeline sequencing rules and leftovers-okayView live
9inline-contentInline vs. block includes — options = ["inline"] across all content typesView live
10page-specificPer-page resolution — same token, different content per pageView live
11page-templatesMulti-page generation — the template field for file-based page expansionView live
12include-templatesTemplate rendering for includes — one token expands to many items; TOML and directory sources; inline mode; step orderingView live
13emoji-alsoAlias emoji — the also field lets multiple include steps share one emoji so one template works with different data sourcesView live
14builtin-sourcesSystem integration — datetime, git, environment, metadata, navigation (alphabetical + numeric sort), index; live data on every buildView live
15nav-and-indexNavigation and index — prev/next links, position tokens, per-page metadata, auto-generated listingsView live
16css-js-templatesCSS/JS templates — no-escape for variable injection; type = "raw" for verbatim contentView live
17file-handlingFile handling options — checksum, skip-by-checksum, add-dot, strip-extension, dotfiles, preserve with missing-ok, flat copyView live
18basic-blogBlog with navigation and template-rendered index — template, excerpt, navigation, index with item templateView live
19conditional-includeConditional section — show or hide an HTML block using a gate TOML, fallback, and chain-reaction tokensView live
20infinite-scrollJavaScript infinite scroll — using navigation data attributes for dynamic UXView live
21external-pathsExternal content — allow-external-paths with relative paths and fallbackView live
22context-fieldContext field — static context overrides, root context _, nested destinationsView live
23counter-sourceAuto-incrementing counters — type = "counter" for repeated blocks with distinct data; comparison with template renderingView live
24combining-tokensToken composition — key construction and two-pass resolution using step orderView live
25nested-sitesNested processing — independent configuration, include sources, and emoji namespace per sectionView live
99full-siteProduction example — all features working together in a complete siteView live

Learning Path

Core concepts (examples 1–5)

  1. Start with example 1 — the absolute minimum config
  2. Example 2 — add your first template processing
  3. Example 3 — convert Markdown content to HTML
  4. Example 4 — verify assets with checksums
  5. Example 5 — handle mixed content types automatically

Include patterns (examples 6–10)

  1. Example 6 — build reusable HTML components
  2. Example 7 — manage variables in TOML
  3. Example 8 — step ordering: pipeline sequencing rules and leftovers-okay
  4. Example 9 — control inline vs. block formatting
  5. Example 10 — per-page content resolution (SSI’s most flexible feature)

Multi-page generation (example 11)

  1. Example 11 — generate many pages from one template

Template rendering (example 12)

  1. Example 12 — expand one token into many rendered items using TOML or directory sources

System integration (examples 13–16)

  1. Example 13 — alias emoji with the also field; reuse one template across different data sources
  2. Example 14 — use datetime, git, environment, and metadata sources; live data on every build
  3. Example 15 — navigation and index sources: prev/next links, position tokens, per-page metadata, and auto-generated listings
  4. Example 16 — process CSS and JS as templates; use type = "raw" for verbatim content
  5. Example 17 — file handling and preserve patterns

Practical sites (examples 18–21)

  1. Example 18 — a complete blog with navigation, excerpts, and template-rendered index
  2. Example 19 — conditional section via fallback gate: show or hide a whole HTML block at build time
  3. Example 20 — JavaScript infinite scroll built entirely from SSI navigation data
  4. Example 21 — external content access as a plugin system alternative

Advanced composition (examples 22–25)

  1. Example 22 — advanced context and nested destination organization
  2. Example 23 — counter source for repeated blocks with distinct data; comparison with template rendering
  3. Example 24 — token construction and two-pass resolution
  4. Example 25 — nested processing: independent configuration, include sources, and emoji namespace per section

Full-site (example 99)

  1. Example 99 — all features together in a production-ready site

Example Structure

Each example contains:

  • site/ — The source files and ssi-config.toml
  • expected-deploy/ — The built output
  • expected-deploy-hashes.toml — Hash record of expected output files
  • test-assertions.toml — Semantic assertions run by the test suite
  • README.md — Explanation of what the example teaches

Using the Examples

Run locally

# Clone the repository
                git clone https://codeberg.org/mattdm/super-simple-includes.git
                cd super-simple-includes
                
                # Build an example
                cd examples/01-copy-only
                ssi deploy site/ output/
                

Copy as a starting point

# Copy an example as your starting point
                cp -r examples/10-page-specific/site/ my-new-site/
                cd my-new-site/
                # Edit files, then:
                ssi deploy . ../my-deploy/
                

Run the test suite

All examples are validated by the integration test suite on every commit:

python3 scripts/run-all-tests.py integration