Resources and assets
get_asset- The asset at
pathunderassets/, or none. find_asset- The first asset matching the glob
pattern, or none. find_assets- All assets matching
pattern. get_remote- A remote resource (
options: headers, method, body, key). Errors propagate unlessoptional=true(then none and a warning). concat_assets- Concatenates
itemsinto a resource attarget. asset_from_string- A resource at
targetwithcontent. get_resource- The resource named
namein a list (case-insensitive), or none. find_resource- The first resource matching the glob
pattern, or none. find_resources- All resources matching
pattern. by_type- Resources whose type is
type(image,page, …). fingerprint- The resource renamed with its hash (
algo: sha256 default, sha384, sha512, md5); setsdata.integrity. minify- The minified resource.
resource_content- The text of a resource; for a bundled content page, its rendered HTML (marked safe).
publish- Publishes the resource and returns it.
to_css- Sass/SCSS to CSS.
js_build- Bundles with rolldown.
execute_as_template- Renders the asset as a Tera template with
data, published attarget. post_process- Defers the resource’s fields until all pages are rendered.
purge_css- A placeholder that each page’s published output replaces with the rules of the CSS (a resource or string) that page uses: the tags, classes and ids of its elements, the words of its
<script>elements.safelistnames (or/regex/) count as used;greedykeeps any selector whose text contains the string or matches the/regex/;blocklistnames drop their selectors;contentresources or strings (scripts that add classes) count their words as used on every page;variables=truedrops custom properties nothing kept references;important=falsedrops!important. Printed compactly for the project’s browserslist targets. E.g.<style>{{ css | purge_css(content=[js]) }}</style>.