{{ $show_descriptions := .show_descriptions }} {{ $show_images := .show_images }}
{{ range .pages }} {{- $page := false -}} {{/* Check if . is a map or page url, necessary when pages/grid is called outside block context */}} {{ if reflect.IsMap . }} {{- $page = partial "GetPageByUrl" .page -}} {{ else }} {{- $page = partial "GetPageByUrl" . -}} {{ end }} {{ with $page }}

{{- partial "PrepareHTML" .Title -}}

{{ if and $show_descriptions .Params.summary }} {{ if site.Params.pages.index.truncate_description }}

{{ partial "GetTruncateContent" ( dict "text" .Params.summary "length" site.Params.pages.index.truncate_description ) }}

{{ else }}

{{ partial "PrepareText" .Params.summary }}

{{ end }} {{ end }} {{ if $show_images }} {{- partial "pages/page-media.html" . -}} {{ end }}
{{- end -}} {{ end }}