hugo-theme-hello-friend/layouts/archive/list.html

50 lines
2.2 KiB
HTML
Raw Permalink Normal View History

2019-04-16 16:55:53 +02:00
{{ define "main" }}
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
2019-04-16 16:55:53 +02:00
<div class="archive">
<h1>{{ .Title }}</h1>
{{ range .Site.RegularPages.GroupByPublishDate "2006" }}
{{ if ne .Key "0001" }}
<div class="archive__group-year">
<h2 class="archive__group-year-header">{{ replace .Key "0001" "" }}</h2>
{{ range .Pages.GroupByDate "January" }}
<div class="archive__group-month">
<h3 class="archive__group-month-header">{{ .Key }}</h3>
<div class="archive__group-posts">
{{ range where .Pages "Type" $contentTypeName }}
{{ if eq .Kind "page" }}
2022-10-23 11:16:46 +02:00
<article class="archive__post">
<h3 class="archive__post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h3>
<div class="archive__post-meta">
2022-10-23 11:16:46 +02:00
<time class="archive__post-date">
{{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
2022-10-23 11:16:46 +02:00
</time>
{{ with .Params.Author }}
<span class="archive__post-author"
>—
{{ $.Site.Params.WrittenBy | default "Written by" }}
{{ . }}
</span>
{{ end }}
{{ if $.Site.Params.ShowReadingTime }}
<span class="archive__post-read-time"
>— {{ .ReadingTime }}
{{ $.Site.Params.MinuteReadingTime | default "min read" }}</span
>
{{ end }}
</div>
2022-10-23 11:16:46 +02:00
</article>
{{ end }}
{{ end }}
</div>
</div>
{{ end }}
2019-04-16 16:55:53 +02:00
</div>
{{ end }}
2019-04-16 16:55:53 +02:00
{{ end }}
</div>
{{ end }}