33# The Posts page layout
44---
55
6+ <!-- Page Header -->
7+ < div class ="page-header ">
8+ < h1 > {{ page.title | default: "Blog Posts" }}</ h1 >
9+ < p > Thoughts, experiences, and insights in technology and engineering</ p >
10+ </ div >
11+
612< div id ="post-list ">
7- {% for post in site.posts %}
13+
14+ {% assign pinned_posts = site.posts | where: "pin", true %}
15+ {% assign regular_posts = site.posts | where_exp: "item", "item.pin != true" %}
16+
17+ {% for post in pinned_posts %}
18+ < div class ="post-preview ">
19+ < h1 >
20+ < a href ="{{ post.url | relative_url }} "> {{ post.title }}</ a >
21+ </ h1 >
22+
23+ < div class ="post-content ">
24+ < p > {{ post.content | markdownify | strip_html | truncate: 200 }}</ p >
25+ </ div >
26+
27+ < div class ="post-meta ">
28+ < div >
29+ < i class ="far fa-calendar "> </ i >
30+ {{ post.date | date: "%Y-%m-%d" }}
31+
32+ < i class ="far fa-clock "> </ i >
33+ {% capture words %}{{ post.content | number_of_words }}{% endcapture %}
34+ {% if words contains '-' %}
35+ 1 min read
36+ {% else %}
37+ {{ words | plus: 250 | divided_by: 250 | append: ' min read' }}
38+ {% endif %}
39+ </ div >
40+
41+ < div class ="pin ">
42+ < i class ="fas fa-thumbtack "> </ i >
43+ < span > Pinned</ span >
44+ </ div >
45+ </ div >
46+ </ div >
47+ {% endfor %}
48+
49+ {% for post in regular_posts %}
850 < div class ="post-preview ">
951 < h1 >
1052 < a href ="{{ post.url | relative_url }} "> {{ post.title }}</ a >
1153 </ h1 >
54+
1255 < div class ="post-content ">
1356 < p > {{ post.content | markdownify | strip_html | truncate: 200 }}</ p >
1457 </ div >
15- < div class ="post-meta text-muted ">
16- < i class ="far fa-calendar fa-fw "> </ i >
17- {{ post.date | date: "%Y-%m-%d" }}
58+
59+ < div class ="post-meta ">
60+ < div >
61+ < i class ="far fa-calendar "> </ i >
62+ {{ post.date | date: "%Y-%m-%d" }}
63+
64+ < i class ="far fa-clock "> </ i >
65+ {% capture words %}{{ post.content | number_of_words }}{% endcapture %}
66+ {% if words contains '-' %}
67+ 1 min read
68+ {% else %}
69+ {{ words | plus: 250 | divided_by: 250 | append: ' min read' }}
70+ {% endif %}
71+ </ div >
1872 </ div >
1973 </ div >
2074{% endfor %}
21- </ div >
75+
76+ </ div > <!-- #post-list -->
0 commit comments