Hey. I already have a working code that displays all the tags in the collection posts and counts their number in all posts.
Here is the code:
{% assign tags = site.blog | map: 'tags' | uniq %} {% assign postInTagCount = 0 %} <div class="blog-tags__tags-wrapper"> {% for tag in tags %} <a href="/blog/tags/#{'#'}{{ tag | downcase }}"> <div class="tags_wrapper__tag"> {{ tag }} {% for post in site.blog %} {% if post.tags contains tag %} {% capture postInTagCount %}{{ postInTagCount | plus:1 }}{% endcapture %} {% endif %} {% endfor %} {% if postInTagCount <> 0 %} [{{ postInTagCount }}]{% endif %} {% capture postInTagCount %}0{% endcapture %} </div> </a> {% endfor %} What it looks like:
But I would like to display the 5 most popular tags that are found in the posts of the selected collection.
I have an example: https://www.codeofclimber.ru/tags/
But I'm not sure if Jekyll is used on this site or not. On Gitkhab in the repositories of the author I did not find his site.
I ask for your help. Thank.
