blog/layouts/section/archives.html

24 lines
828 B
HTML
Raw Normal View History

2024-05-06 17:30:24 +08:00
{{ define "main" }}
<div class="page--archive">
{{- range (where (where .Site.Pages "Type" "in" "posts") "Kind" "page").GroupByDate "2006" }}
{{ if (where .Pages "Section" "posts") }}
<h2 class="archive--title__year">{{ .Key }}</h2>
{{ range .Pages.ByPublishDate.Reverse.GroupByDate "January" }}
<h3 class="archive--title__month">{{ .Key }}</h3>
<ul class="archive--list">
{{ range ((where .Pages "Section" "posts")) }}
<li class="archive--item">
<div class="archive--title">
<a href="{{ .RelPermalink }}">
{{ .Title }}
</a>
</div>
<div class="archive--meta">{{ .PublishDate.Format "Jan 02" }}</div>
</li>
{{ end }}
</ul>
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}