Use for loop on index page instead of hardcoding post numbers

This commit is contained in:
Philipp Oppermann
2020-01-28 16:04:51 +01:00
parent 7d27a2c4a4
commit 78f55a701f
2 changed files with 15 additions and 20 deletions

View File

@@ -82,7 +82,7 @@ main img {
border: 2px solid #fc0 border: 2px solid #fc0
} }
.posts.exceptions { .posts.interrupts {
border: 2px solid #f66; border: 2px solid #f66;
} }
@@ -117,7 +117,7 @@ main img {
color: #990; color: #990;
} }
.post-category.exceptions { .post-category.interrupts {
color: #f33; color: #f33;
} }

View File

@@ -23,27 +23,22 @@
</p> </p>
</div> </div>
<div id="bare-bones" class="post-category bare-bones">Bare Bones</div> <div>
<div class="posts bare-bones"> {% set chapter = "none" %}
{{ macros::post_link(page=posts.0) }} {% for post in posts %}
{{ macros::post_link(page=posts.1) }} {% if post.extra["chapter"] %}
{{ macros::post_link(page=posts.2) }} {% if post.extra["chapter"] != chapter %}
{{ macros::post_link(page=posts.3) }} {# Begin new chapter #}
{% set_global chapter = post.extra["chapter"] %}
</div> </div>
<div id="exceptions" class="post-category exceptions">Exceptions</div> <div id="{{chapter | slugify}}" class="post-category {{chapter | slugify}}">{{ chapter }}</div>
<div class="posts exceptions"> <div class="posts {{chapter | slugify}}">
{{ macros::post_link(page=posts.4) }} {% endif %}
{{ macros::post_link(page=posts.5) }} {% endif %}
{{ macros::post_link(page=posts.6) }}
</div>
<div id="memory-management" class="post-category memory-management">Memory Management</div> {{ macros::post_link(page=post) }}
<div class="posts memory-management"> {% endfor %}
{{ macros::post_link(page=posts.7) }}
{{ macros::post_link(page=posts.8) }}
{{ macros::post_link(page=posts.9) }}
{{ macros::post_link(page=posts.10) }}
</div> </div>
<div class="posts subscribe"> <div class="posts subscribe">