{{asset}} helper

{{asset}} is a helper used to retrieve asset URLs

Syntax:

{{ asset "PATH_TO_ASSET" }}

Example:

{{ asset "css/main.css" }}

It returns URL concatenated by the following way:

DOMAIN + ASSETS_PATH + PATH_TO_ASSET

Where DOMAIN is a domain specified under server settings. ASSETS_PATH is a value from theme config under files.assetsPath, and PATH_TO_ASSET is a param value.

Create your first website with Publii

Join thousands of creators who chose independence. Create content locally and publish lightning-fast, secure websites on your own terms.

Download Publii

Free and open source. Windows, macOS and Linux.

Read the getting started guide