hugo-stanley/layouts/partials/note-list.html

40 lines
1.8 KiB
HTML
Raw Permalink Normal View History

2020-03-03 18:56:59 +01:00
{{- $paginator := . -}}
{{- if gt $paginator.TotalPages 0 -}}
{{- $dateFormat := site.Params.dateFormat -}}
{{- if not $dateFormat -}}{{- $dateFormat = "2006-01-02" -}}{{- end -}}
{{- range $index, $page := $paginator.Pages -}}
<div id="{{ if eq (mod $index 2) 0}}grey{{ else }}white{{ end }}">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<!-- <p><img src="img/user.png" width="50px" height="50px">
<ba>Stanley Stinson</ba>
</p>-->
{{- if $page.Date -}}
<bd>{{- $page.Date.Format $dateFormat -}}</bd>
{{- end -}}
<h4>{{- $page.Title | safeHTML -}}</h4>
{{- if $page.Summary -}}<p class="note content">{{- $page.Summary | plainify | safeHTML -}}{{- if $page.Truncated -}}<span class="mldr">&mldr;{{- T "more" -}}</span>{{- end -}}</p>{{- end -}}
{{- $relURL := $page.RelPermalink -}}
{{- $imgs := $page.Params.imgs -}}
{{- with $page.Params.imgs -}}
<span class="note imgs">
{{- $imgCount := len $imgs -}}
{{- range $imgs -}}
{{- $imgurl := lower $page -}}
{{- if and (not (hasPrefix $imgurl "http://")) (not (hasPrefix $imgurl "https://")) -}}
{{- $imgurl = path.Join $relURL $page -}}
{{- end -}}
<img class="img" src="{{- $imgurl -}}" alt />
{{- end -}}
</span>
{{- end -}}
<p><a href="{{- $page.RelPermalink -}}">Continue Reading...</a></p>
{{- partial "note-labels.html" $page -}}
</div>
</div>
</div>
</div>
{{ end }}
{{ end }}