26 lines
615 B
HTML
26 lines
615 B
HTML
|
<!--
|
||
|
The trending tags list
|
||
|
|
||
|
© 2019 Cotes Chung
|
||
|
MIT Licensed
|
||
|
-->
|
||
|
|
||
|
{% assign MAX = 10 %}
|
||
|
|
||
|
{% capture tags_array %}
|
||
|
{% for tag in site.tags %}
|
||
|
{{ tag[1] | size }}:{{ tag[0] | replace: ' ', '-' }}
|
||
|
{% endfor %}
|
||
|
{% endcapture %}
|
||
|
|
||
|
{% assign trends = tags_array | split: " " | sort | reverse %}
|
||
|
{% assign count = 0 %}
|
||
|
|
||
|
{% for trend in trends %}
|
||
|
{% assign count = count | plus: 1 %}
|
||
|
{% assign tag = trend | split: ":" | last %}
|
||
|
<a class="post-tag" href="{{ site.baseurl }}/tags/{{ tag | downcase }}/">{{ tag | replace: '-', ' ' }}</a>
|
||
|
{% if count >= MAX %}
|
||
|
{% break %}
|
||
|
{% endif %}
|
||
|
{% endfor %}
|