Skip to content

Instantly share code, notes, and snippets.

@pixelstorm
Created October 16, 2024 05:41
Show Gist options
  • Save pixelstorm/26cc31261bc9ce6ff666d40177b06e41 to your computer and use it in GitHub Desktop.
Save pixelstorm/26cc31261bc9ce6ff666d40177b06e41 to your computer and use it in GitHub Desktop.
shopify liquid canonical conditional statement
{% if template contains 'collection' and current_tags %}
<meta name="robots" content="noindex" />
<link rel="canonical" href="{{ shop.url }}{{ collection.url }}" />
{% else %}
<link rel="canonical" href="{{ canonical_url }}" />
{% endif %}
@pixelstorm
Copy link
Author

taken as a backup from the orginal theme.liquid file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment