website-theme/layouts/blog/list.html

47 lines
1.4 KiB
HTML
Raw Normal View History

{{ define "main"}}
{{ partial "header.html" . }}
<main>
2022-05-08 18:02:35 -04:00
{{ partial "search.html" . }}
2022-05-08 18:06:32 -04:00
{{ partial "tags/all.html" . }}
<br/>
{{ $posts := where site.RegularPages "Type" "blog" }}
{{ $postCount := len $posts }}
{{ range last 1 $posts }}
{{ $tags := .Site.Taxonomies.tags }}
2023-01-03 21:00:27 -05:00
<div class='bloglist-teaser block-center'>
Hello! This page contains <strong>{{ $postCount | lang.NumFmt 0 }} posts</strong>
written in the past <strong>{{ div (sub now.Unix .Date.Unix) 31536000 }} years</strong>
2022-11-22 23:25:30 -05:00
spanning
{{ len $tags }} topics within the dropdown above.
</div>
{{ end }}
<!-- contents -->
2022-11-22 23:25:30 -05:00
<div class="bloglist">
{{ $listPageDateFormat := .Site.Params.listPageDateFormat | default "January, 2006"}}
{{ range $index, $value := .Pages.GroupByDate $listPageDateFormat }}
2022-05-08 18:02:35 -04:00
{{ if (ne $index 0) }}
<hr class="separator">
{{ end }}
2022-11-22 23:25:30 -05:00
<p class="bloglist-date">{{ .Key }}</p>
2022-05-08 18:02:35 -04:00
{{ range .Pages }}
<div class="bloglist-item">
<p><a href="{{ .Permalink }}">{{ .Title }}</a></p>
<p class="bloglist-item-tag">
{{ range .Params.tags }}
{{ $name := . }}
{{ with $.Site.GetPage (printf "/tags/%s" (. | urlize)) }}
<span><a href="{{ .Permalink }}">#{{ $name }}</a> </span>
{{ end }}
{{ end }}
</p>
</div>
2022-05-08 18:02:35 -04:00
{{ end }}
{{ end }}
</div>
</main>
{{ end }}