Skip to content

Instantly share code, notes, and snippets.

View namurray's full-sized avatar

Nicole A Murray namurray

View GitHub Profile
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>My Website</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/main.css">
@namurray
namurray / tag-cloud.scss
Created May 4, 2017 15:46
Shopify tag cloud CSS
.word-cloud {
display: inline-block;
max-width: 630px;
li {
display: inline-block;
padding: 0 1rem;
vertical-align: middle;
}
}
@namurray
namurray / tag-cloud.liquid
Last active May 3, 2017 22:10
Shopify tag cloud
<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