Skip to content

Instantly share code, notes, and snippets.

@shopifypartners
Last active September 11, 2020 17:44
Show Gist options
  • Save shopifypartners/fbe0d8683d6bab5992c2101d315f9dfa to your computer and use it in GitHub Desktop.
Save shopifypartners/fbe0d8683d6bab5992c2101d315f9dfa to your computer and use it in GitHub Desktop.
Initial case statement for various template types for accessible breadcrumbs - https://www.shopify.com/partners/blog/breadcrumb-navigation
{% assign t = template | split: '.' | first %}
<nav class="breadcrumbs" aria-label="breadcrumbs">
<ol>
<li>
<a href="/" title="Home">Home</a>
</li>
{% case t %}
{% when 'page' %}
{% comment %} breadcrumb link output {% endcomment %}
{% else %}
<li aria-current="page">
<a href="{{ request.path }}" aria-current="page">{{ page_title }}</a>
</li>
{% endcase %}
</ol>
</nav>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment