{{ $options := .options }} {{ $heading_level := .heading_level | default 3 }} {{ $heading_tag := partial "GetHeadingTag" (dict "level" $heading_level "attributes" "class='page-title'" )}}
{{ 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 }}
{{ $heading_tag.open }} {{- partial "PrepareHTML" .Title -}} {{ $heading_tag.close }} {{ if and $options.summary .Params.summary }}

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

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