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
|
{{ define "main" }}
{{ $posts := (where site.RegularPages "Section" "posts").ByDate.Reverse }}
{{ $lead := index $posts 0 }}
{{ $rest := after 1 $posts }}
{{ $years := $rest.GroupByDate "2006" }}
<div class="page-index column">
{{ partial "colophon.html" . }}
<div class="index-body">
{{ with $lead }}
<div class="index-lead rise" style="--i: 1">
<span class="label">{{ i18n "latest" }} · {{ .Date.Format "January 2, 2006" }}</span>
<a class="title" href="{{ .RelPermalink }}">{{ .Title }}</a>
<span class="excerpt">{{ .Summary }}</span>
<span class="more" aria-hidden="true">{{ i18n "readMore" }}</span>
</div>
{{ end }}
{{ range $i, $year := $years }}
<section class="year rise" style="--i: {{ add $i 2 }}">
<h2 class="year__label">
{{ $year.Key }}
<span class="count">{{ i18n "postsCount" (dict "Count" (len $year.Pages)) }}</span>
</h2>
<ul class="year__list">
{{ range $year.Pages }}
<li class="entry">
<span class="date">{{ .Date.Format "Jan 02" }}</span>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</li>
{{ end }}
</ul>
</section>
{{ end }}
</div>
</div>
{{ end }}
|