layout | title | permalink |
---|---|---|
page |
Traductions par catégories |
/traductions_categories/ |
Trouvé sur https://codinfox.github.io/dev/2015/03/06/use-tags-and-categories-in-your-jekyll-based-github-pages/ The following part extracts all the tags from your posts and sort tags, so that you do not need to manually collect your tags to a place.
{% endcomment %} {% assign rawtags = "" %} {% for post in site.posts %} {% assign ctags = post.tags | join:'|' | append:'|' %} {% assign rawtags = rawtags | append:ctags %} {% endfor %} {% assign rawtags = rawtags | split:'|' | sort %}
{% endcomment %} {% assign tags = "" %} {% for tag in rawtags %} {% if tag != "" %} {% if tags == "" %} {% assign tags = tag | split:'|' %} {% endif %} {% unless tags contains tag %} {% assign tags = tags | join:'|' | append:'|' | append:tag | split:'|' %} {% endunless %} {% endif %} {% endfor %}
{% endcomment %}
{% for tag in tags %}
{{ tag }}
{% endfor %}
{% endcomment %}
{% for tag in tags %}
{{ tag }} ⤴︎
-
{% for post in site.posts %}
{% if post.tags contains tag %}
- {% endif %} {% endfor %}