Jekyll Plugin to generate each tag-page and use tag-information.
<h1>Awsome Post A</h1>
<h2>Tags for the Post</h2>
<ol>
<li><a href="/tags/avengers4/">Endgame</a></li>
<li><a href="/tags/avengers3/">Infinity War</a></li>
</ol><h1>Tag: Endgame (123 posts)</h1>
<ol>
<li><a href="/2019/04/27/awsome-post-a/">Awsome Post A</a></li>
...
</ol><h1>All Tags (456 tags)</h1>
<ol>
<li><a href="/tags/avengers2/">Age of Ultron</a></li>
<li><a href="/tags/avengers4/">Endgame</a></li>
<li><a href="/tags/avengers3/">Infinity War</a></li>
<li><a href="/tags/avengers1/">Marvel's The Avengers</a></li>
...
</ol>Put jekyll_tiny_tag.rb into your _plugins directory
Tag information produced by this plugin is named tagging.
-
Prepare your
layoutfor each tag-page.pageof tag-page already has tagging.Liquid meaning eg page.tagging.tagthe tagyou wrote in yourfront matteravengers part 4 page.tagging.datayour tag data for the tagdescribed in_data/tags.yml{'title': 'Endgame', 'hulk': 'smash'}page.tagging.titlepage.tagging.data.titleortagitselfEndgame page.tagging.slugslugified tagavengers-part-4 page.tagging.urlurlof tag-page/tags/avengers-part-4/ page.tagging.postspostsfiltered by thetag[post1, post2, ...] -
(Optional) Set config into
_config.yml# defaults tiny_tag: dir: tags # where to output layout: tag.html # means _layouts/tag.html for each tag-page slug: # jekyll slug options for tagging.slug mode: default cased: false
-
(Optional) Describe tag data in
_data/tags.yml# key is tag itself # value is any hash data you want to use in layout avengers: title: Marvel's The Avengers hulk: smash budapest: - clint - natasha
-
Run Jekyll
page except tag-page do not have tagging(s),
you have to get with filters.
You can use tagify (tags to taggings)
and to_array_of_keys (hash-key to array)
sort-mode: none (default, as-is)
{% assign taggings = page.tags | tagify %}
{% assign taggings = site.tags | to_array_of_keys | tagify %}
sort-mode: date (latest post date)
{% assign taggings = page.tags | tagify: 'date' %}
{% assign taggings = site.tags | to_array_of_keys | tagify: 'date' %}
sort-mode: title (alphabetically)
{% assign taggings = page.tags | tagify: 'title' %}
{% assign taggings = site.tags | to_array_of_keys | tagify: 'title' %}-
front matterof post--- tags: - avengers ---
-
_data/tags.ymlavengers: title: Marvel's The Avengers hulk: smash
-
layoutof post{% assign taggings = page.tags | tagify %} {% for tagging in taggings %} {{ tagging.title }} {{ tagging.data.hulk }} {% endfor %} -
layoutof tag-page{{ page.tagging.title }} {{ page.tagging.data.hulk }}
-
front matterof post--- tags: - Marvel's The Avengers ---
-
layoutof tag-page<a href="{{ page.tagging.url | relative_url }}"> {{ page.tagging.title | escape }} </a>
-
./tags.html--- permalink: /tags/ --- {% assign taggings = site.tags | to_array_of_keys | tagify: 'title' %} {% for tagging in taggings %} <a href="{{ tagging.url | relative_url }}"> {{ tagging.title | escape }} </a> {% endfor %}