Last active
January 26, 2021 13:40
-
-
Save sskylar/8956549d1ae9dc91c89e74b1c5a0d8c9 to your computer and use it in GitHub Desktop.
Sort Jekyll tags by popularity (number of posts)
Thanks! 😃
My result is
<ul>
</li>
<li data-sort="0000"><a href="/tags/tomato">Tomato <span>100</span></a></li>
<li data-sort="0080"><a href="/tags/kale">Kale <span>20</span></a></li>
<li data-sort="0099"><a href="/tags/arugula">Arugula <span>1</span></a></li>
<li data-sort="0099"><a href="/tags/bok-choy">Bok choy <span>1</span></a></li>
<li data-sort="0099"><a href="/tags/zucchini">Zucchini <span>1</span></a>
</ul>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Outputs something like:
Tags are sorted descending based on the number of posts, included within a
<span>
tag. Any tags with the same number of posts are sorted alphabetically.