@@ -8,6 +8,34 @@ <h1 class="post-title">{{ page.title }}</h1>
8
8
< p class ="post-meta "> {{ page.date | date: "%b %-d, %Y" }}{% if page.author %} • {{ page.author }}{% endif %}{% if page.meta %} • {{ page.meta }}{% endif %}</ p >
9
9
</ header >
10
10
11
+ {% if page.categories %}
12
+ {% assign category = page.categories[0] %}
13
+ {% assign posts = site.categories[category] %}
14
+ {% for post in posts %}
15
+ {% if post.url == page.url %}
16
+ {% assign post_index0 = forloop.index0 %}
17
+ {% assign post_index1 = forloop.index %}
18
+ {% endif %}
19
+ {% endfor %}
20
+ {% for post in posts %}
21
+ {% if post_index0 == forloop.index %}
22
+ {% assign next_post = post %}
23
+ {% endif %}
24
+ {% if post_index1 == forloop.index0 %}
25
+ {% assign prev_post = post %}
26
+ {% endif %}
27
+ {% endfor %}
28
+ {% endif %}
29
+
30
+ < div class ="post-category-navigation ">
31
+ {% if prev_post != nil %}
32
+ < a class ="prev " href ="{{ prev_post.url }} "> « {{ prev_post.title }}</ a >
33
+ {% endif %}
34
+ {% if next_post != nil %}
35
+ < a class ="next " href ="{{ next_post.url }} "> {{ next_post.title }} »</ a >
36
+ {% endif %}
37
+ </ div >
38
+
11
39
< article class ="post-content " style ="margin-bottom: 0px ">
12
40
{{ content }}
13
41
</ article >
0 commit comments