add data for categories
This commit is contained in:
parent
6aab62813d
commit
932b7df85d
2 changed files with 10 additions and 0 deletions
5
_data/categories.yml
Normal file
5
_data/categories.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
"Collaboratif":
|
||||||
|
C'est un texte pour exemple
|
||||||
|
"Démocratie":
|
||||||
|
Voila un autre texte
|
||||||
|
|
|
@ -13,7 +13,12 @@ category: base
|
||||||
|
|
||||||
{% for item in (0..site.categories.size) %}{% unless forloop.last %}
|
{% for item in (0..site.categories.size) %}{% unless forloop.last %}
|
||||||
{% capture this_word %}{{ categories_list[item] | strip_newlines }}{% endcapture %}
|
{% capture this_word %}{{ categories_list[item] | strip_newlines }}{% endcapture %}
|
||||||
|
|
||||||
<h2 id="{{ this_word }}">{{ this_word }}</h2>
|
<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">
|
<ul class="post-list">
|
||||||
{% for post in site.categories[this_word] %}{% if post.title != null %}
|
{% 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>
|
<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>
|
||||||
|
|
Loading…
Reference in a new issue