Sha256: df7e14b594836b81b80429486b939814c7d84bfd4b91e82e3a116d581d66eddf
Contents?: true
Size: 1001 Bytes
Versions: 4
Compression:
Stored size: 1001 Bytes
Contents
<div class="post-meta"> <span class="post-date">{{ include.post.date | date_to_string }}</span> <span class="post-categories"> {% for category in include.post.categories %} • {% comment %} Check if this category has a corresponding page before decide to link to it. This is an O(n^2) operations so consider removing it and linking for all categories (or no categories) if this site has a lot of pages and/or a lot of categories. {% endcomment %} {% assign category_page = false %} {% for node in site.pages %} {% if node.category == category or node.title == category %} {% assign category_page = node %} {% endif %} {% endfor %} {% if category_page %} <a href="{{ category_page.url | relative_url }}"> {{ category_page.title | default: category_page.category }} </a> {% else %} {{ category }} {% endif %} {% endfor %} </span> </div>
Version data entries
4 entries across 4 versions & 1 rubygems