itsdrike.com/layouts/posts/list.html
2022-05-11 14:38:42 +02:00

40 lines
1.3 KiB
HTML

{{ define "main" }}
<div id="main">
<div class="container">
<!-- TODO:
- Mention total post amt
- Total words across posts
- link to tag list page (and maybe remove link from content-details),
- Link for Hugo generated RSS
-->
<div class="item-list">
{{ partial "content.html" . }}
<!-- Go through post groups by year -->
{{ range .Data.Pages.GroupByDate "2006" }}
{{ $year := .Key }}
<div class="item-list-group">
<!-- Show the year for this group -->
<h3 class="item-list-year" id="{{ $year }}">
<a href="#{{ $year }}">
<time datetime="{{ $year }}" title='{{ $year }}'>{{ $year }}</time>
</a>
</h3>
<!-- List all posts in this year group -->
<ul class="item-list-items">
{{ range .Pages }}
<li class="item-list-item" data-id="{{ with .File}}{{ .File.UniqueID }}{{ end }}">
{{ .Scratch.Set "dateformat" "Jan 02" }}
{{ partial "list_item.html" . }}
</li>
{{ end }}
</ul>
</div>
{{ end }}
</div>
</div>
</div>
{{ end }}