Skip to content

Commit

Permalink
doc: more details about assets
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudLigny committed Feb 24, 2025
1 parent 3a0c736 commit 18755fe
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/3-Templates.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
description: "Working with layouts, templates and components."
date: 2021-05-07
updated: 2025-02-06
updated: 2025-02-24
alias: documentation/layouts
-->
# Templates
Expand Down Expand Up @@ -494,7 +494,11 @@ For convenience the `url` function is also available as a filter:

### asset

Creates an asset (CSS, JavaScript, image, audio, etc.) from a file path, an URL or an array of files path (bundle).
An asset is a resource useable in templates, i.e.: CSS, JavaScript, image, audio, etc.

The `asset()` function creates an _asset_ object from a file path, an array of files path (bundle) or an URL (remote file), and are processed (minified, fingerprinted, etc.) according to the [configuration](4-Configuration.md#assets).

Local files must be stored in the `assets/` (or `static/`) directory.

```twig
{{ asset(path, {options}) }}
Expand All @@ -508,10 +512,6 @@ Creates an asset (CSS, JavaScript, image, audio, etc.) from a file path, an URL
| ignore_missing | Do not stop build if file don't exists. | boolean | `false` |
| remote_fallback | Load a local asset if the remote one don't exists. | string | `null` |

:::info
Refers to [assets configuration](4-Configuration.md#assets) to define the global behavior.
:::

:::tip
Uses [filters](#filters) to manipulate assets.
:::
Expand Down

0 comments on commit 18755fe

Please sign in to comment.