preload_tag
Generates an HTML <link> tag with the rel attribute set to preload, prioritizing the loading of a given Shopline-hosted asset. The asset's URL is also added to the Link header with the rel attribute set to preload.
Parameters
url{String}: The CDN URL link. This parameter is required.[attribute]{Object}: Options to pass HTML link tag attributes. Optional. Therelattribute cannot be overridden.returns{String}: Returns an HTML string.
Usage
{{ preload_tag url [attribute] }}
Example
{{ preload_tag '/some_font.woff' as='font' }}
HTML Attributes
You can define HTML attributes by including a parameter corresponding to the attribute name with the desired value.
{{ preload_tag '/some_font.woff' as='font' media='mobile' type='font/woff' }}
Was this article helpful to you?