Page-Specific Includes [Home]

This is the home page with its own variables

Built with Super-Simple Includes

Welcome to our site

Welcome to the page-specific variables demonstration! This welcome message is coming from texts/index/welcome.md, which is specific to the index page.

This page demonstrates how the same variable names can have different values on different pages. Compare this page with the About page to see the differences.

What Makes This Page Special

This home page uses variables defined in the [index] section of strings.toml, which override the default values from the [_] section.

Key differences you’ll notice:

Page-Specific Text Files

This file is located at texts/index/welcome.md which means it only appears on the index page. When index.html includes 📜welcome, Super-Simple Includes looks for:

  1. Page-specific versiontexts/index/welcome.mdYou’re reading this!
  2. Default fallbacktexts/welcome.md (used by other pages)

Navigate to the About page to see how it gets different content from the same include!

Page-Specific Content

This demonstrates page-specific variable resolution:

Current Page Variables

Global Variables (Same on All Pages)

How Page-Specific Variables Work

  1. Default Values: Defined in [_] section of strings.toml
  2. Page Overrides: Each page can have its own [pagename] section
  3. Resolution Order: Page-specific first, then global defaults
  4. Same Variable Names: Different values per page

Navigate between pages to see how the same variables show different content!

Why Per-Page Context Matters

Per-page content resolution is one of SSI’s most useful features — and it requires zero configuration beyond directory structure.

The key insight: you can use a shared widget (header, sidebar, nav, footer, call-to-action) across every page in your site, and each page can supply its own values for that widget’s tokens. The widget file stays the same; the data changes per page.

This means:

Adding a new page never requires editing any shared widget files. Drop the page in the right place, add a subdirectory with the page-specific content files, and the site builds correctly.

How It Scales

As sites grow, this pattern keeps the template layer stable. Compare this to approaches where each page hardcodes its own copy of shared components — edits to the shared structure require touching every file. With per-page resolution, the shared structure lives in one place.

See it in a real context: Example 99 (full-site) uses per-page resolution throughout its four-page structure, with a shared header and footer receiving different page context on each page.