Resources and assets

get_asset
The asset at path under assets/, 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 unless optional=true (then none and a warning).
concat_assets
Concatenates items into a resource at target.
asset_from_string
A resource at target with content.
get_resource
The resource named name in 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); sets data.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 at target.
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. safelist names (or /regex/) count as used; greedy keeps any selector whose text contains the string or matches the /regex/; blocklist names drop their selectors; content resources or strings (scripts that add classes) count their words as used on every page; variables=true drops custom properties nothing kept references; important=false drops !important. Printed compactly for the project’s browserslist targets. E.g. <style>{{ css | purge_css(content=[js]) }}</style>.

    Type to search titles, headings and text.