www/layouts/_default/list.html

35 lines
794 B
HTML
Raw Normal View History

{{ define "main" }}
2021-03-23 17:44:02 +01:00
<h1>{{ .Title }}</h1>
{{ with .Content }}
{{ . }}
{{ end }}
{{ if .Parent.IsHome }}
{{ $.Scratch.Set "blog-pages" (where .Site.RegularPages "Section" .Section) }}
{{ else }}
{{$.Scratch.Set "blog-pages" .Pages }}
{{ end }}
{{ $pag := .Paginate (( $.Scratch.Get "blog-pages").GroupByPublishDate "2006")}}
{{ range $pag.PageGroups }}
{{ if ne .Key "0001" }}
<h2>{{ T "post_posts_in" }} {{ .Key }}</h2>
<ul>
{{ range .Pages }}
<li>{{ .PublishDate.Format "2006-01-02" }} - <a href="{{ .RelPermalink }}">{{ .Title }}</a> : {{ .Description }}</li>
{{ end }}
</ul>
{{ else }}
<h2>Docs</h2>
<ul>
{{ range .Pages }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a> : {{ .Description }}</li>
{{ end }}
</ul>
{{ end }}
{{ end }}
{{ partial "pagination.html" . }}
{{ end }}