content_type에 의해 게시 카테고리를 의미한다고 가정합니다. 당신은 당신의 게시물의 YAML Front Matter에
category: type_1
을 추가하거나 type_1/_posts
폴더에서 해당 게시물을 넣어 귀하의 게시물을 분류 할 수 있습니다. 우리가 이것을 가지고 있다면, 당신이 원하는 것을하는 약간 끈적한 방법이 있습니다 :
<div>
{% assign count1 = true %}
{% assign count2 = true %}
{% assign count3 = true %}
{% assign count4 = true %}
{% for post in site.posts %}
{% if post.categories contains 'type_1' or post.categories contains 'type_2' or ... %}
{% if count1 == true or count2 == true or count3 == true or count4 == true %}
<li><span>{{ post.date | date_to_string }}</span> » <a href="{{ post.url }}">{{ post.title }}</a></li>
{% if count1 == true %}
{% assign count1 = false %}
{% elsif count2 == true %}
{% assign count2 = false %}
{% elsif count3 == true %}
{% assign count3 = false %}
{% elsif count4 == true %}
{% assign count4 = false %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
</div>