{{- $paginator := . -}}

{{- if gt $paginator.TotalPages 0 -}}
{{- $dateFormat := site.Params.dateFormat -}}
{{- if not $dateFormat -}}{{- $dateFormat = "2006-01-02" -}}{{- end -}}
<ul class="note list">
    {{- range $paginator.Pages -}}
      {{- $relURL := replace .RelPermalink "#" "%23" -}}
      {{- $relURL = replace $relURL "." "%2e" -}}
    <li class="item"><a class="note" href="{{- $relURL -}}">
            <p class="note title">{{- .Title | safeHTML -}}</p>
            {{- if .Date -}}
                <p class="note date">{{- .Date.Format $dateFormat -}}</p>
            {{- end -}}
            {{- if .Summary -}}<p class="note content">{{- .Summary | plainify | safeHTML -}}{{- if .Truncated -}}<span class="mldr">&mldr;</span>{{- end -}}</p>{{- end -}}
            
            {{- $imgs := .Params.imgs -}}
            {{- with $imgs -}}
                <span class="note imgs">
                    {{- $imgCount := len $imgs -}}
                    {{- range $imgs -}}
                    {{- $imgurl := lower . -}}
                    {{- if and (not (hasPrefix $imgurl "http://")) (not (hasPrefix $imgurl "https://")) -}}
                    {{- $imgurl = path.Join $relURL . -}}
                    {{- end -}}
                    <img class="img" src="{{- $imgurl -}}" alt />
                    {{- end -}}
                </span>
            {{- end -}}
        </a>
        {{- partial "note-labels.html" . -}}
    </li>
    {{- end -}}
</ul>
{{- end -}}