Browse code

Added archive_post partial Added post_category partial Added archives page

Brandon Mathis authored on 27/06/2011 at 21:38:51
Showing 3 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,8 @@
0
+{% capture category %}{{ post.categories | size }}{% endcapture %}
1
+<h1><a href="{{ post.url }}">{{post.title}}</a></h1>
2
+<time datetime="{{ post.date | datetime }}" pubdate>{{ post.date | date: "<span class='month'>%b</span> <span class='day'>%d</span> <span class='year'>%Y</span>"}}</time>
3
+{% if category != '0' %}
4
+<footer>
5
+  <span class="categories">posted in {{ post.categories | category_links }}</span>
6
+</footer>
7
+{% endif %}
0 8
new file mode 100644
... ...
@@ -0,0 +1,10 @@
0
+{% capture category %}{% if post %}{{ post.categories | category_links | size }}{% else %}{{ page.categories | category_links | size }}{% endif %}{% endcapture %}
1
+{% unless category == '0' %}
2
+<span class="categories"> in
3
+  {% if post %}
4
+    {{ post.categories | category_links }}
5
+  {% else %}
6
+    {{ page.categories | category_links }}
7
+  {% endif %}
8
+</span>
9
+{% endunless %}
0 10
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+---
1
+layout: post
2
+title: Blog Archive
3
+no_meta: true
4
+---
5
+<div class="blog-archives">
6
+{% for post in site.posts reverse %}
7
+{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
8
+{% unless year == this_year %}
9
+  {% assign year = this_year %}
10
+  <h2>{{ year }}</h2>
11
+{% endunless %}
12
+<article>
13
+  {% include archive_post.html %}
14
+</article>
15
+{% endfor %}
16
+</div>