sipp11
10 years ago
8 changed files with 49 additions and 4 deletions
@ -0,0 +1,31 @@ |
|||||||
|
--- |
||||||
|
layout: default |
||||||
|
title: Categories |
||||||
|
permalink: /categories/ |
||||||
|
header_display: true |
||||||
|
--- |
||||||
|
<!--TODO: Find a fix to tags with spaces--> |
||||||
|
<ul class="tag_box inline"> |
||||||
|
{% if site.categories.first[0] != null %}{% comment %} If tags exist {% endcomment %} |
||||||
|
{% for category in site.categories %}{% comment %} add an element like the following for each tag item {% endcomment %} |
||||||
|
<li><a href="#{{ category[0] }}"><span class="label label-success">{{ category[0] }}</span> {% comment %} This is just the tag name {% endcomment %} |
||||||
|
<span>{{ category[1].size }}</span>{% comment %} This counts the number of posts in a given tag {% endcomment %} |
||||||
|
</a></li> |
||||||
|
{% endfor %} |
||||||
|
{% endif %} |
||||||
|
</ul> |
||||||
|
|
||||||
|
{% for category in site.categories %} |
||||||
|
<h1 id="{{ category[0] }}">{{ category[0] }}</h1> |
||||||
|
<ul> |
||||||
|
{% for post in category[1] %} |
||||||
|
{% if post.title != null %} |
||||||
|
{% if page.url == post.url %} |
||||||
|
<li class="active"><a href="#" class="active">{{post.title}}</a></li> |
||||||
|
{% else %} |
||||||
|
<li>{{ post.date | date: "%B %e, %Y" }} » <a href="{{post.url}}">{{post.title}}</a></li> |
||||||
|
{% endif %} |
||||||
|
{% endif %} |
||||||
|
{% endfor %} |
||||||
|
</ul> |
||||||
|
{% endfor %} |
Loading…
Reference in new issue