Created
January 16, 2017 17:01
-
-
Save joe-dempsey/d4326d7a08790129bcc07a7c08667662 to your computer and use it in GitHub Desktop.
dynamic href lang tags liquid shopify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
Here we have 2 stores: | |
www.urbanexcess.com | |
www.usd.urbanexcess.com | |
set dynamic href lang tags for each to avoid dup. content issues | |
{% endcomment %} | |
<!-- hreflang tags ================================================== --> | |
<link rel="alternate" hreflang="x-default" href="{{ canonical_url | replace: shop.domain, 'www.urbanexcess.com' }}" /> | |
<link rel="alternate" href="{{ canonical_url | replace: shop.domain, 'www.urbanexcess.com' }}" hreflang="en-GB" /> | |
<link rel="alternate" href="{{ canonical_url | replace: shop.domain, 'www.usd.urbanexcess.com' }}" hreflang="en-US" /> | |
<link rel="alternate" href="{{ canonical_url | replace: shop.domain, 'www.urbanexcess.com' }}" hreflang="en" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Joe, thank you for your comment. I found a solution how to get it working with subfolders.
You can take a look at it at this website
I think this website is the only one where it is working correctly when you work with Shopify Markets.
The automated tags which Shopify uses I switched off.