Sha256: bef5ebb296283c6429aaa33cdac5880774253fca57e8576b796d7d82dfdb3721

Contents?: true

Size: 1.47 KB

Versions: 4

Compression:

Stored size: 1.47 KB

Contents

---
layout:   post
---

{{ content }}

{% comment%}
https://stackoverflow.com/a/28105741

Here we generate all the tags.
from: https://codinfox.github.io/dev/2015/03/06/use-tags-and-categories-in-your-jekyll-based-github-pages/
{% endcomment%}

{% assign rawtags = "" %}

{% assign collection= site.collections | where: "label", page.collection | first %}
{% assign items = collection.docs | sort: 'order' %}

{% for post in items %}
{% assign ttags = post.categories | join:'|' | append:'|' %}
{% assign rawtags = rawtags | append:ttags %}
{% endfor %}

{% assign rawtags = rawtags | split:'|' | sort %}

{% 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 %}

<div>
<p>
  {% for tag in tags %}
  <a href="#{{ tag | slugify }}" class=""> {{ tag }} </a> &nbsp;&nbsp;
  {% endfor %}
</p>

{% for tag in tags %}
<h3 id="{{ tag | slugify }}">{{ tag }}</h2>
  {% for post in items %}
  {% if post.categories contains tag %}
  <ul class="actions">
    <li>
      <a class="button special" href="{{ post.url | absolute_url }}">
        {{ post.title }}
      </a>
      {% for tag in post.categories %}
        <a class="button" href="{{ page.url | absolute_url }}#{{ tag | slugify }}">{{ tag }}</a>
      {% endfor %}
    </li>
  </ul>
  {% endif %}
  {% endfor %}
{% endfor %}

</div>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fortyone-jekyll-theme-1.2.3 _layouts/categories.html
fortyone-jekyll-theme-1.2.2 _layouts/categories.html
fortyone-jekyll-theme-1.2.1 _layouts/categories.html
fortyone-jekyll-theme-1.2.0 _layouts/categories.html