add data for categories

This commit is contained in:
mose 2017-09-08 19:55:04 +08:00
parent 6aab62813d
commit 932b7df85d
2 changed files with 10 additions and 0 deletions

5
_data/categories.yml Normal file
View file

@ -0,0 +1,5 @@
"Collaboratif":
C'est un texte pour exemple
"Démocratie":
Voila un autre texte

View file

@ -13,7 +13,12 @@ category: base
{% for item in (0..site.categories.size) %}{% unless forloop.last %}
{% capture this_word %}{{ categories_list[item] | strip_newlines }}{% endcapture %}
<h2 id="{{ this_word }}">{{ this_word }}</h2>
{% if site.data.categories[this_word] %}
<div class="categorytext">{{ site.data.categories[this_word] }}</div>
{% endif %}
<ul class="post-list">
{% for post in site.categories[this_word] %}{% if post.title != null %}
<li><a href="{{ site.url }}{{ post.url }}">{{ post.title }}<span class="entry-date"><time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date_to_string }}</time></span></a>