Overview
The core concepts:
- Filesystem-based Routing - Your directory structure becomes your site structure
- Templates and layouts - Eta layouts chosen by folder, which replace the layouts above them
- Markdown Pipeline - Enhanced Markdown processing with extensible plugins
- Collections - Listings, pagination and one page per tag
- Incremental Static Generation (ISG) - Smart caching and selective rebuilds
- Static Assets & Bundling - Copying
public/, client TypeScript bundles and stylesheets
The Stati philosophy
TypeScript-first
Stati is built with TypeScript from the ground up, providing:
- Full type safety for configuration with
stati.config.ts - IntelliSense in your editor for all configuration options
- Built-in esbuild compilation for your client-side TypeScript code
- Multiple bundles with per-page targeting via include/exclude patterns
- Automatic script tag injection during dev and build (no template changes needed)
- Bundle paths available via
stati.assetsfor preloading or custom use - Development mode with source maps; production mode with minification and hashing
How it all works together
Here’s how these concepts combine when you’re working with Stati:
1. Content creation
You write content in Markdown files with front matter metadata. The file location determines the URL structure.
2. Template processing
Stati uses Eta templates to render your content, with support for:
- Layouts chosen by folder (the nearest
layout.eta) or per page - Includes and shared page shells
- Template helpers
- Collections, pagination and generated pages
3. Asset processing
Stati copies everything from your configured staticDir into the output folder. It runs Tailwind CSS itself when stati dev and stati build get --tailwind-input and --tailwind-output (see CSS). For other preprocessing, such as Sass, use project-level scripts or the options generated by create-stati. Production builds link stylesheets under names that change with their content.
4. Smart caching
ISG tracks dependencies and only rebuilds what’s necessary:
- A changed page is re-rendered; unchanged pages are served from the cache
- Template changes rebuild the pages that use them
- Static assets are copied on every build; an image in the page’s Markdown or from
stati.image()is one of its dependencies, so replacing it rebuilds that page - Time-based cache expiration for content that changes over time
5. Output generation
The result is static HTML in dist/ that any static host can serve.
Getting deeper
Start with Filesystem-based Routing to understand how Stati maps your content to URLs, then explore the other concepts to master the full Stati workflow.
Related topics
- Glossary – Definitions of key terms and concepts