Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save blueprintmrk/ddbb2502143d2a8ce32ec7b97e8bf082 to your computer and use it in GitHub Desktop.
Save blueprintmrk/ddbb2502143d2a8ce32ec7b97e8bf082 to your computer and use it in GitHub Desktop.
Case statement for blog template to build accessible breadcrumbs - https://www.shopify.com/partners/blog/breadcrumb-navigation
{% when 'blog' %}
{% if current_tags %}
<li>{{ blog.title | link_to: blog.url }}</li>
<li>
{% capture tag_url %}{{blog.url}}/tagged/{{ current_tags | join: "+" }}{% endcapture %}
<a href="{{ tag_url }}" aria-current="page">{{ current_tags | join: " + " }}</a>
</li>
{% else %}
<li>
<a href="{{ blog.url }}" aria-current="page">{{ blog.title }}</a>
</li>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment