hugo-theme-noteworthy/layouts/section/archives.html

29 lines
856 B
HTML
Raw Permalink Normal View History

2020-02-02 17:13:02 +00:00
{{ define "main" }}
<!-- All of the site's posts grouped by year -->
<h1>
Archives
</h1>
<div>
<!-- Group all the post pages from the same year -->
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ range ($pages.GroupByDate "2006") }}
<h3>{{ .Key }}</h3> <!-- Display the year -->
<ul class="archives-list">
{{ range (.Pages) }}
<li class="archives-list-item">
<span class="archives-list-item-date">{{ .PublishDate.Format "Jan 2" }}</span>
<span>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</span>
</li>
{{ end }}
</ul>
{{ end }}
</div>
<div class="page-footer"></div>
{{ end }}