Last active
May 3, 2017 22:10
-
-
Save namurray/b5382ccc0f0840438516706b5e2ba1e5 to your computer and use it in GitHub Desktop.
Shopify tag cloud
This file contains 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
<ul class="word-cloud"> | |
{% for tag in blogs['BLOG-HANDLE'].all_tags %} | |
{% assign count = 0 %} | |
{% for article in blogs[blog.handle].articles %} | |
{% if article.tags contains tag %} | |
{% capture count %}{{ count | plus: 1 }}{% endcapture %} | |
{% endif %} | |
{% endfor %} | |
{% assign count = count | plus: 0 %} | |
<li class="tag-{% if count <= 3 %}alpha | |
{%elsif count >= 4 and count < 9 %}beta | |
{%elsif count >= 9 and count < 12 %}gamma | |
{%elsif count >= 12 and count < 20 %}delta | |
{%endif%}"> | |
<a href="{{ blog.url }}/tagged/{{ tag | handle }}">{{ tag }}</a> | |
</li> | |
{% endfor %} | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment