{{js}} helper

It creates URL to the JS file from the js catalog in the assets directory. Additionally, it adds to the file URL the v= param. For stylesheets use css; for other theme files use asset.

Syntax:

{{js "filepath.js"}}

Example:

<script src="{{js "main.js"}}"></script>

Example output:

<script src="https://example.com/assets/js/main.js?v=a928f6898da46898a928f6898da46898"></script>

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