mirror of
https://github.com/monero-project/monero-site.git
synced 2024-12-23 12:09:49 +00:00
Merge !1037
Sort tags by popularity in blog See merge request monero-project/monero-site!1037
This commit is contained in:
commit
9c23312468
1 changed files with 13 additions and 2 deletions
|
@ -59,10 +59,21 @@ layout: custom
|
|||
<h2>Popular Tags</h2>
|
||||
</div>
|
||||
</div>
|
||||
{% for tag in site.data.tags limit:4 %}
|
||||
{% capture taglist %}
|
||||
{% for site_tag in site.tags %}
|
||||
{% for data_tag in site.data.tags %}
|
||||
{% if data_tag.slug == site_tag[0] %}
|
||||
;{{ site_tag[1].size | plus: 100000 }}#{{ data_tag.name }}#{{ data_tag.slug }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endcapture %}
|
||||
{% assign sortedtags = taglist | strip | remove_first: ';' | split:';' | sort | reverse %}
|
||||
{% for tagitem in sortedtags limit: 6 %}
|
||||
{% assign pop_tag = tagitem | strip | split: '#' %}
|
||||
<div class="row start-xs">
|
||||
<div class="col">
|
||||
<p><a href="/blog/tags/{{ tag.slug }}.html">{{ tag.name }}</a></p>
|
||||
<p><a href="/blog/tags/{{ pop_tag[2] }}.html">{{ pop_tag[1] }}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
|
Loading…
Reference in a new issue