sipp11
10 years ago
5 changed files with 156 additions and 1 deletions
@ -0,0 +1,41 @@ |
|||||||
|
--- |
||||||
|
layout: default |
||||||
|
title : Archive |
||||||
|
--- |
||||||
|
<section id="archive"> |
||||||
|
{% assign posts_collate = site.posts %} |
||||||
|
|
||||||
|
{% for post in posts_collate %} |
||||||
|
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} |
||||||
|
{% capture this_month %}{{ post.date | date: "%B" }}{% endcapture %} |
||||||
|
{% capture this_month_num %}{{ post.date | date: "%m" }}{% endcapture %} |
||||||
|
{% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %} |
||||||
|
{% capture next_month %}{{ post.previous.date | date: "%B" }}{% endcapture %} |
||||||
|
|
||||||
|
{% if forloop.first %} |
||||||
|
<h1 id="{{this_year}}">{{this_year}}</h1> |
||||||
|
<h2 id ="{{this_year}}:{{this_month_num}}">{{this_month}}</h2> |
||||||
|
<ul> |
||||||
|
{% endif %} |
||||||
|
|
||||||
|
<li id="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%B %e, %Y" }} » <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></li> |
||||||
|
|
||||||
|
{% if forloop.last %} |
||||||
|
</ul> |
||||||
|
{% else %} |
||||||
|
{% if this_year != next_year %} |
||||||
|
</ul> |
||||||
|
<h1 id="{{ next_year }}">{{next_year}}</h1> |
||||||
|
<h2 id="{{ next_year }}:{{ next_month }}">{{next_month}}</h2> |
||||||
|
<ul> |
||||||
|
{% else %} |
||||||
|
{% if this_month != next_month %} |
||||||
|
</ul> |
||||||
|
<h2 id="{{ next_year }}:{{ next_month }}">{{next_month}}</h2> |
||||||
|
<ul> |
||||||
|
{% endif %} |
||||||
|
{% endif %} |
||||||
|
{% endif %} |
||||||
|
{% endfor %} |
||||||
|
{% assign posts_collate = nil %} |
||||||
|
</section> |
@ -0,0 +1,29 @@ |
|||||||
|
--- |
||||||
|
layout: default |
||||||
|
title: Tags |
||||||
|
--- |
||||||
|
<!--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 tag in site.categories %}{% comment %} add an element like the following for each tag item {% endcomment %} |
||||||
|
<li><a href="#{{ tag[0] }}"><span class="label label-success">{{ tag[0] }}</span> {% comment %} This is just the tag name {% endcomment %} |
||||||
|
<span>{{ tag[1].size }}</span>{% comment %} This counts the number of posts in a given tag {% endcomment %} |
||||||
|
</a></li> |
||||||
|
{% endfor %} |
||||||
|
{% endif %} |
||||||
|
</ul> |
||||||
|
|
||||||
|
{% for tag in site.categories %} |
||||||
|
<h1 id="{{ tag[0] }}">{{ tag[0] }}</h1> |
||||||
|
<ul> |
||||||
|
{% for tag_post in tag[1] %} |
||||||
|
{% if tag_post.title != null %} |
||||||
|
{% if page.url == tag_post.url %} |
||||||
|
<li class="active"><a href="#" class="active">{{tag_post.title}}</a></li> |
||||||
|
{% else %} |
||||||
|
<li>{{ tag_post.date | date: "%B %e, %Y" }} » <a href="{{tag_post.url}}">{{tag_post.title}}</a></li> |
||||||
|
{% endif %} |
||||||
|
{% endif %} |
||||||
|
{% endfor %} |
||||||
|
</ul> |
||||||
|
{% endfor %} |
Loading…
Reference in new issue