{% comment %}Managed by ShopSheriff Shopify app{% endcomment %}

{% if template contains 'product' %}
  {% unless product.handle.size > 0 %}
    {% assign denyAmp = true %}
  {% endunless %}
  {% assign amp_path = '/products/' | append: product.handle %}
{% endif %}
{% if template contains 'collection' %}
  {% unless collection.handle == 'all' %}
  {% unless current_tags %}
  {% unless collection.current_type %}
  {% unless collection.current_vendor %}
  {% if collection.products_count %}
    {% assign amp_path = '/collections/' | append: collection.handle %}
    {% if current_page > 1 %}
      {% assign amp_path = amp_path | append: '?page=' | append: current_page %}
    {% endif %}
  {% endif %}
  {% endunless %}
  {% endunless %}
  {% endunless %}
  {% endunless %}
{% endif %}

{% unless denyAmp %}
{% if amp_path %}
   <link rel="amphtml" href="{{ 'https://' | append: 'eartheyewearsunglasses.com/a/s' | append: amp_path  }}">
{% endif %}
{% endunless %}
