2019-12-31 16:17:27 +01:00
|
|
|
<!--
|
|
|
|
The trending tags list
|
2020-01-02 14:17:49 +01:00
|
|
|
v2.0
|
|
|
|
https://github.com/cotes2020/jekyll-theme-chirpy
|
2019-12-31 16:17:27 +01:00
|
|
|
© 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 %}
|
2020-04-24 08:49:45 +02:00
|
|
|
<a class="post-tag" href="{{ site.baseurl }}/tags/{{ tag | downcase | url_encode }}/">{{ tag | replace: '-', ' ' }}</a>
|
2019-12-31 16:17:27 +01:00
|
|
|
{% if count >= MAX %}
|
|
|
|
{% break %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|