forked from poole/lanyon
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
85 lines (75 loc) · 2.84 KB
/
Copy pathindex.html
File metadata and controls
85 lines (75 loc) · 2.84 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
layout: default
title: Home
page_class: home
---
<main class="site-main">
<div class="home-list">
{% for post in paginator.posts %}
{%- assign wc = post.content | number_of_words -%}
{%- assign mins = wc | divided_by: 90 -%}
{%- if mins == 0 %}{%- assign mins = 1 %}{%- endif -%}
<article class="home-card{% if post.image %} has-media{% endif %}">
<!-- ── Col 1: meta (24px baseline grid — each item aligns with one content line) ── -->
<div class="home-card-meta">
<time class="home-card-date" datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%b'%y" }}</time>
{% if post.series %}
<span class="home-card-series-name">{{ post.series_title }}</span>
<span class="home-card-series-part">Part {{ post.series_part }}</span>
{% elsif post.categories.size > 0 %}
<span class="home-card-cat">{{ post.categories | first | capitalize }}</span>
{% endif %}
<span class="home-card-readtime">{{ mins }} min</span>
</div>
<!-- ── Col 2: content ── -->
<div class="home-card-body">
<h2 class="home-card-title">
<a href="{{ post.url }}">{{ post.title }}</a>
</h2>
{% if post.subtitle %}
<p class="home-card-subtitle">{{ post.subtitle }}</p>
{% endif %}
{% if post.description and post.description != "" %}
<p class="home-card-desc">{{ post.description }}</p>
{% elsif post.excerpt %}
<p class="home-card-desc">{{ post.excerpt | strip_html | truncatewords: 42 }}</p>
{% endif %}
<div class="home-card-footer">
{% if post.series and post.categories.size > 0 %}
<span class="home-card-cat-inline">{{ post.categories | first | capitalize }}</span>
{% endif %}
{% if post.tags.size > 0 %}
<div class="home-card-tags">
{% for tag in post.tags limit:4 %}
<span class="home-card-tag">{{ tag }}</span>
{% endfor %}
</div>
{% endif %}
</div>
</div>
<!-- ── Col 3: media (only when post.image set) ── -->
{% if post.image %}
<div class="home-card-media">
<img src="{{ post.image }}" alt="{{ post.title }}" loading="lazy">
</div>
{% endif %}
</article>
{% endfor %}
</div>
<div class="pagination">
{% if paginator.next_page %}
<a class="pagination-item older" href="{{ site.baseurl }}/page{{paginator.next_page}}">Older</a>
{% else %}
<span class="pagination-item older">Older</span>
{% endif %}
{% if paginator.previous_page %}
{% if paginator.page == 2 %}
<a class="pagination-item newer" href="{{ site.baseurl }}/">Newer</a>
{% else %}
<a class="pagination-item newer" href="{{ site.baseurl }}/page{{paginator.previous_page}}">Newer</a>
{% endif %}
{% else %}
<span class="pagination-item newer">Newer</span>
{% endif %}
</div>
</main>