{{ $show_descriptions := .show_descriptions }} {{ $show_images := .show_images }}
{{ range .pages }} {{- $file := false -}} {{/* Check if . is a map or page url, necessary when pages/grid is called outside block context */}} {{ if reflect.IsMap . }} {{ $file = .file }} {{ else }} {{ $file = . }} {{ end }} {{ $page := site.GetPage $file }} {{ 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 }}