Added layout for multiple categories
Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
parent
580f394eed
commit
d3027d91b0
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
{{ content }}
|
||||
<ul class="post-list list-unstyled">
|
||||
{% assign categories = page.categories | split:',' %}
|
||||
{% assign posts = site.categories[categories.first] %}
|
||||
{% for category in categories %}
|
||||
{% if category != categories.first %}
|
||||
{% assign posts = site.categories[category] | concat: posts %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% assign posts = posts | sort: 'date' | reverse %}
|
||||
{% for post in posts %}
|
||||
<li class="mb-4">
|
||||
<span class="small text-muted">{{ post.date | date: "%b %-d, %Y" }}</span>
|
||||
<p class="h4 post-title">
|
||||
<a class="post-link" href="{{ post.url | absolute_url }}">{{ post.title }}</a>
|
||||
</p>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
Loading…
Reference in New Issue