Static AssetsΒΆ
The static pipeline discovers co-located CSS, JS, and module files, deduplicates them across requests, and injects them into HTML.
The default injection points are the collect_* template tags, which mark placeholder slots in the layout.
Extra slots register through default_placeholders.register, so projects can add their own injection points beyond styles and scripts.
The pipeline is fully pluggable through asset kinds, custom stems, and backends.
Concepts
- Static Assets Overview
The mental model behind the pipeline.
- Co-located Files
How asset files are paired with pages and components.
Authoring
- Static Template Tags
Template tags that emit the collected output.
- JavaScript Context
Exposing context to the browser through the
Nextobject.
Mechanics
- Deduplication
How the framework avoids emitting the same asset twice.
- Asset Kinds
Built-in kinds and how to register new ones.
- Custom Stems
Recognise additional filenames as component assets.
Extending
- Static Backends
Customizing the collector and the injection format through backends.
- Static Signals
Every signal the static subsystem emits.