JS

Get the URL to a javascript file in your theme.


Example

{{ theme:js src="scripts" }}
/site/themes/redwood/js/scripts.js

If you leave off the src parameter, the tag will use the theme name as the filename.

{{ theme:js }}
/site/themes/redwood/js/redwood.js

Add the tag parameter to output a script tag.

{{ theme:js src="scripts" tag="true" }}
<script src="/site/themes/redwood/js/scripts.js"></script>

Parameters

src

string

The path to the Javascript file, relative to the js directory. You can leave off the extension, we know it's a .js file.

version

boolean false

If you are using Elixir to manage your theme assets, setting this to true will use the manifest to output the filename.

cache_bust

boolean false

Setting this to true will add the timestamp of the asset to the end of the URL in a ?v= query param. Use this to version files if you are not using Elixir.

absolute

boolean false

Render the URL in an absolute format.

Last modified on August 22, 2017