Permalink
Browse files

add tag and category support

  • Loading branch information...
imrickysu committed Feb 19, 2015
1 parent 9772f01 commit 8f52b8cd26fb851ca1fed2a23986a23170b05b4c
Showing with 59 additions and 10 deletions.
  1. +8 −10 _config.yml
  2. +26 −0 categories.md
  3. +25 −0 tags.md
@@ -13,20 +13,18 @@ google_analytics_id: UA-51284079-1 # set tracking, UA-XXXX-Y.
links:

- name: 首页
url: http://blog.rickysu.com
external: true
- name: RSS订阅
url: /feed.xml
- name: TWITTER
url: /
- name: 文章分类
url: /categories
- name: Tags
url: /tags/
- name: 联系我@Twitter
url: http://twitter.com/rickysu
external: true
- name: E-MAIL
url: mailto:i@rickysu.com
external: true
- name: 关于我
url: /about


- name: RSS订阅
url: /feed.xml



@@ -0,0 +1,26 @@
---
layout: page
title: 文章分类
permalink: /categories/
---

<ul class="tags-box">
{% if site.posts != empty %}
{% for cat in site.categories %}
<a href="#{{ cat[0] }}" title="{{ cat[0] }}" rel="{{ cat[1].size }}">{{ cat[0] | join: "/"}}<span class="size"> {{ cat[1].size }}</span></a>
{% endfor %}
</ul>

<ul class="tags-box">
{% for cat in site.categories %}
<li id="{{ cat[0] }}">{{ cat[0]}}</li>
{% for post in cat[1] %}
<time datetime="{{ post.date | date:"%Y-%m-%d" }}">{{ post.date | date:"%Y-%m-%d" }}</time> &raquo;
<a href="{{ site.url }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a><br />
{% endfor %}
{% endfor %}
{% else %}
<span>No posts</span>
{% endif %}
</ul>

25 tags.md
@@ -0,0 +1,25 @@
---
layout: page
title: Tags
permalink: /tags/
---

<ul class="tags-box">
{% if site.posts != empty %}
{% for tag in site.tags %}
<a href="#{{ tag[0] }}" title="{{ tag[0] }}" rel="{{ tag[1].size }}">{{ tag[0] }}<span class="size"> {{ tag[1].size }}</span></a>
{% endfor %}
</ul>

<ul class="tags-box">
{% for tag in site.tags %}
<li id="{{ tag[0] }}">{{ tag[0] }}</li>
{% for post in tag[1] %}
<time datetime="{{ post.date | date:"%Y-%m-%d" }}">{{ post.date | date:"%Y-%m-%d" }}</time> &raquo;
<a href="{{ site.url }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a><br />
{% endfor %}
{% endfor %}
{% else %}
<span>No posts</span>
{% endif %}
</ul>

0 comments on commit 8f52b8c

Please sign in to comment.