|
8 | 8 | <div class="pagination">
|
9 | 9 | <!-- Post list links -->
|
10 | 10 | <ul class="post-list">
|
11 |
| - {%- for post in paginator.posts -%} |
12 |
| - <li> |
13 |
| - {%- assign date_format = site.yat.date_format | default: "%b %-d, %Y" -%} |
14 |
| - |
15 |
| - {% assign article = post.content %} |
16 |
| - {% assign lang = post.lang %} |
17 |
| - {%- include functions.html func='get_reading_time' -%} |
18 |
| - {% assign reading_time = return %} |
19 |
| - {%- include functions.html func='get_article_excerpt' -%} |
20 |
| - {% assign excerpt = return %} |
21 |
| - {%- assign post_url = post.url | relative_url -%} |
| 11 | + <!-- Top list item --> |
| 12 | + {%- if paginator == site or paginator.page == 1 -%} |
| 13 | + {%- assign post_item_class = "top-post" -%} |
| 14 | + {%- assign posts = site.posts |
| 15 | + | where_exp: "item", "item.top > 0" |
| 16 | + | sort: "top" -%} |
| 17 | + {%- for post in posts -%} |
| 18 | + {%- include views/pagination-item.html -%} |
| 19 | + {%- endfor -%} |
| 20 | + {%- endif -%} |
22 | 21 |
|
23 |
| - <h2 class="post-title"> |
24 |
| - <a class="post-link" href="{{ post_url }}"> |
25 |
| - {{ post.title | escape }} |
26 |
| - </a> |
27 |
| - </h2> |
28 |
| - <div class="post-meta"> |
29 |
| - <span class="post-date"><i class="fa fa-calendar"></i> {{ post.date | date: date_format }}</span> |
30 |
| - <span class="post-reading-time left-vsplit"><i class="fa fa-clock-o"></i> {{ reading_time }}</span> |
31 |
| - </div> |
32 |
| - <a class="post-excerpt" href="{{ post_url }}"> |
33 |
| - <p> |
34 |
| - {{ excerpt }} <span class="read_more">Read More</span> |
35 |
| - </p> |
36 |
| - </a> |
37 |
| - <div class="post-tags"> |
38 |
| - {%- for tag in post.tags -%} |
39 |
| - <a class="post-tag" href="{{ '/tags.html ' | relative_url }}#{{tag}}">#{{tag}}</a> |
40 |
| - {%- endfor -%} |
41 |
| - </div> |
42 |
| - </li> |
| 22 | + <!-- Normal list item --> |
| 23 | + {%- assign post_item_class = "" -%} |
| 24 | + {%- for post in paginator.posts -%} |
| 25 | + {%- if post.top -%} |
| 26 | + {%- continue -%} |
| 27 | + {%- endif -%} |
| 28 | + {%- include views/pagination-item.html -%} |
43 | 29 | {%- endfor -%}
|
44 | 30 | </ul>
|
45 | 31 |
|
|
0 commit comments