Sha256: cb85b0af8dac16e27663f5744055b40f243788bad9a3e139fe1447cef91202d2

Contents?: true

Size: 1.42 KB

Versions: 10

Compression:

Stored size: 1.42 KB

Contents

{% comment %}
  The trending tags list
{% endcomment %}

{% assign MAX = 10 %}

{% assign size_list = "" | split: "" %}
{% assign tag_list = "" | split: "" %}

{% for tag in site.tags %}
  {% assign size = tag | last | size %}
  {% assign size_list = size_list | push: size %}

  {% assign tag_str = tag | first | append: "::" | append: size %}
  {% assign tag_list =  tag_list | push: tag_str %}
{% endfor %}

{% assign size_list = size_list | sort | reverse %}

{% assign tag_list = tag_list | sort_natural %}

{% assign trending_tags = "" | split: "" %}

{% for size in size_list limit: MAX %}
  {% for tag_str in tag_list %}
    {% assign tag = tag_str | split: "::" %}
    {% assign tag_name = tag | first %}
    {% assign tag_size = tag | last | plus: 0 %}
    {% if tag_size == size %}
      {% unless trending_tags contains tag_name %}
        {% assign trending_tags = trending_tags | push: tag_name %}
        {% break %}
      {% endunless %}
    {% endif %}
  {% endfor %}
{% endfor %}

{% if trending_tags.size > 0 %}
  <div id="access-tags">
    <div class="panel-heading">{{- site.data.locales[lang].panel.trending_tags -}}</div>
    <div class="d-flex flex-wrap mt-3 mb-1 mr-3">

    {% for tag_name in trending_tags %}
      {% assign url = tag_name | slugify | url_encode | prepend: "/tags/" | append: "/" %}
      <a class="post-tag" href="{{ url | relative_url }}">{{ tag_name }}</a>
    {% endfor %}

    </div>
  </div>
{% endif %}

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
jekyll-theme-chirpy-5.3.0 _includes/trending-tags.html
jekyll-theme-abd3lraouf-5.2.9 _includes/trending-tags.html
jekyll-theme-abd3lraouf-5.2.8 _includes/trending-tags.html
jekyll-theme-abd3lraouf-5.2.7 _includes/trending-tags.html
jekyll-theme-chirpy-5.2.1 _includes/trending-tags.html
jekyll-theme-chirpy-5.2.0 _includes/trending-tags.html
jekyll-theme-chirpy-5.1.0 _includes/trending-tags.html
jekyll-theme-chirpy-5.0.2 _includes/trending-tags.html
jekyll-theme-chirpy-5.0.1 _includes/trending-tags.html
jekyll-theme-chirpy-5.0.0 _includes/trending-tags.html