{{- define "main" }} {{- $blog := site.Params.blogDir }} {{- if eq .Section $blog }} {{- $pages := where site.RegularPages "Section" $blog }}
{{- $paginator := .Paginate $pages -}} {{- $size := $paginator.PagerSize }} {{- $scratch := newScratch }} {{- range $index, $value := $paginator.Pages }} {{- if isset .Params "image" }} {{- $scratch.Set "image" .Params.image }} {{- else }} {{- $scratch.Set "image" "thumbnail.svg" }} {{- end }} {{- $image := $scratch.Get "image" }} {{- $bg := $image }} {{- if ne (in $image "images") true }} {{- $bg = (absURL (printf "images/%s" $image)) }} {{- end }} {{- if in $image "https://" }} {{- $bg = $image }} {{- end }}
{{- if and (eq $index 0) (gt $size 1) }}
{{ end }} {{- if and (eq $index (add $size -1)) (gt $size 1) }}
{{ end }} {{- end }}
{{- else }} {{- .Content }} {{ if eq .Kind "taxonomy" }}
    {{ range .Data.Pages }}
  1. {{ .Title }}
  2. {{ end }}
{{- end }} {{- end }} {{- end }}