X-Git-Url: https://www.kengrimes.com/gitweb/?p=kengrimes.com%2Ftheme.git;a=blobdiff_plain;f=layouts%2F_default%2Flist.html;fp=layouts%2F_default%2Flist.html;h=46ef1e11cc21f495c841a6163ab2599c4bd1a315;hp=e237c9e5aa5d892a46f0dfe7f6a009747ef9e34b;hb=3bb959dc9aa6955c1d67f45d811a1af7496f3d80;hpb=673df4c901ba419ffd171d19b9186724dda1c16f diff --git a/layouts/_default/list.html b/layouts/_default/list.html index e237c9e..46ef1e1 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,24 +1,40 @@ {{- define "main" -}} -{{ $paginator := .Paginate (where .Data.Pages.ByLastmod.Reverse "Section" .Section) 12 }} -{{- if (gt (len (findRE ")" "\n$1\n
" .Content | strings.TrimLeft "\n " | strings.TrimPrefix "
" | replaceRE "\n" "\n " | safeHTML }} -{{- else -}} -{{ .Content }} -{{- end -}} - {{- if gt (len $paginator.Pages) 0 }} +{{- .Content }} +{{- $paginator := .Paginate .Pages.ByPublishDate.Reverse 6 }} +{{- $.Scratch.Set "cardskip" 0 }} +{{- if eq $paginator.PageNumber 1 }} +{{- $.Scratch.Set "cardskip" 4 }} +{{- range first ($.Scratch.Get "cardskip") $paginator.Pages }} +{{- $ph := cond (or (not .Params.header) (not (fileExists (printf "static/%s" .Params.header)))) (cond (or (not .Parent.Params.header) (not (fileExists (printf "static/%s" .Parent.Params.header)))) "/img/speedy.png" .Parent.Params.header) .Params.header }} +
+ +
+

+ {{ .Title }} +
{{ dateFormat "January 2 2006 15:04 MST" .PublishDate }}
+

+
+
+ {{ .Content | safeHTML | truncate 1024 }} + {{- if .Truncated }} +
Read More...
+ {{- end }} +
+{{- end }} +{{- end }} +{{- $cardskip := $.Scratch.Get "cardskip" }} +{{- if gt (len $paginator.Pages) $cardskip }}
- {{- $rsc := .Resources }} + {{- if gt $cardskip 1 }} + {{- range after $cardskip $paginator.Pages }} + {{- partial "speedycard.html" . -}} + {{- end }} + {{- else }} {{- range $paginator.Pages }} - {{- $secHead := cond (not .Params.header) ($rsc.GetMatch "header.png") (string .Params.header | $rsc.GetMatch) }} - {{- $secHead := cond (not $secHead) (relURL "/img/speedy.png") $secHead.RelPermalink }} - - -
{{ .GitInfo.AuthorDate.Format "January 2 2006" }}
- {{.Title}} -
{{ truncate 100 .Summary }}
-

+ {{- partial "speedycard.html" . -}} + {{- end }} {{- end }}
- {{ template "_internal/pagination.html" . -}} - {{- end }} +{{ partial "pagination.html" . -}} +{{- end }} {{- end -}}