-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathposts.html
More file actions
60 lines (60 loc) · 2.11 KB
/
Copy pathposts.html
File metadata and controls
60 lines (60 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
layout: default
page-key: posts
permalink: /posts/
title: Stories
excerpt: "Distilled thoughts from the tech industry and literature"
pagefind_ignore: true
---
<section class="posts">
<div class="container">
<div class="skew-between">
<div class="row">
<div class="col-md-12">
<div class="content-headline">
<h1 class="posts-header">{{page.title}}</h1>
<p>{{page.excerpt}}</p>
</div>
</div>
</div>
</div>
{% assign visible_posts = site.categories['blog'] | where_exp: "post", "post.archived != true" %}
{% assign archived_count = site.categories['blog'] | where_exp: "post", "post.archived == true" | size %}
{% assign count = 0 %}
{% for post in visible_posts %}
{% assign count = count | plus: 1 %}
{% assign result = count | modulo: 2 %}
{% if result == 1 %}
<div class="row">
{% endif %}
<div class="col-md-6">
<article class="article-list">
<a href="{{ site.baseurl }}{{ post.url }}" title="{{ post.title }}">
{% if count <= 2 %}{% assign loadingMode = 'eager' %}{% else %}{% assign loadingMode = 'lazy' %}{% endif %}
{% include image-feature-list.html loading=loadingMode %}
<h1>{{ post.title }}</h1>
</a>
<time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%B %d, %Y" }}</time>
{% if post.updated %}<time class="post-updated" datetime="{{ post.updated | date_to_xmlschema }}">Last updated {{ post.updated | date: "%B %d, %Y" }}</time>{% endif %}
<p>{{ post.excerpt | strip_html | truncate: 160 }}</p>
</article>
</div>
{% if result == 0 %}
</div>
{% endif %}
{% endfor %}
{% if result == 1 %}
</div>
{% endif %}
{% if archived_count > 0 %}
<div class="row">
<div class="col-md-12">
<p class="archive-link">
<a href="{{ site.baseurl }}/archive/">Browse the archive →</a>
<span class="archive-link-note">Older posts kept for historical reasons.</span>
</p>
</div>
</div>
{% endif %}
</div>
</section>