File tree 1 file changed +8
-13
lines changed
1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change 9
9
< section class ="content ">
10
10
11
11
< ul class ="listing ">
12
- {% for post in site.posts limit:10 %}
13
- < li >
14
- < span > {{ post.date | date_to_string }}</ span > < a href ="{{ BASE_PATH }}{{ post.url }} "> {{ post.title }}</ a >
15
- </ li >
16
- {% endfor %}
17
- {% for category in site.categories %}
18
- {% if category[0] == 'top' %}
19
- {% assign posts = category[1] %}
20
- {% for post in posts %}
21
- < li >
22
- < span > {{ post.date | date_to_string }}</ span > < a href ="{{ BASE_PATH }}{{ post.url }} "> {{ post.title }}</ a >
23
- </ li >
24
- {% endfor %}
12
+ {% assign recent_posts_count = 0 %}
13
+ {% for post in site.posts %}
14
+ {% comment %}always returns first 10 posts, then only 'top' posts after that'{% endcomment %}
15
+ {% if recent_posts_count < 10 or post.categories ! = null and post.categories contains 'top' %}
16
+ < li>
17
+ < span > {{ post.date | date_to_string }}</ span > < a href ="{{ BASE_PATH }}{{ post.url }} "> {{ post.title }}</ a >
18
+ </ li >
25
19
{% endif %}
20
+ {% assign recent_posts_count = recent_posts_count | plus: 1 %}
26
21
{% endfor %}
27
22
</ ul >
28
23
You can’t perform that action at this time.
0 commit comments