link_ to
string | link_to: string
returns string
Generates an HTML <a>
tag.
{{ 'Shopify' | link_to: 'https://www.shopify.com' }}
{{ 'Shopify' | link_to: 'https://www.shopify.com' }}
Output
<a href="https://www.shopify.com" title="" rel="nofollow">Shopify</a>
Anchor to HTML attributes
HTML attributes
string | link_to_type: attribute: string
You can specify HTML attributes by including a parameter that matches the attribute name, and the desired value.
{{ 'Shopify' | link_to: 'https://www.shopify.com', class: 'link-class' }}
{{ 'Shopify' | link_to: 'https://www.shopify.com', class: 'link-class' }}
Output
<a class="link-class" href="https://www.shopify.com" rel="nofollow">Shopify</a>
Was this page helpful?