{{- $site := .Site -}} {{- $page := .Page -}} {{- $section := ($site.GetPage $page.Section) -}} {{ $authors := slice }} {{ with ($page.Params.Authors) }} {{ range . }} {{ $authors = $authors | append . }} {{ end }} {{ end}} {{- $maxLength := 95 -}} {{- $title := $page.Title | strings.Title -}} {{- if eq $page.Section "books" -}} {{- if in $title ":" -}} {{- $title = index (split $title ":") 0 -}} {{- end -}} {{- end -}} {{- if gt (len $title) $maxLength -}} {{- $title = printf "%s..." (substr $title 0 $maxLength) -}} {{- end -}} {{- if .Params.Description -}} {{- .Params.Description -}}
{{- end -}} {{- $title -}} {{- $date := "" -}} {{- if $page.Date -}} {{- $date = $page.Date.Format "2006-01-02" -}} {{- else if $page.Params.Year -}} {{- $date = $page.Params.Year -}} {{- end -}} {{- $in := "" -}} {{ if $page.Params.Language }} {{ if eq $page.Params.Language "Russian" }} {{- $in = printf ", In %s" $page.Params.Language -}} {{ end }} {{ end -}} {{- if or $date $in -}} · {{ $date }}{{ $in }} {{- end -}} {{ with $authors }} · {{ if gt (len .) 3 }} {{- range $index, $author := first 3 . -}}{{ if $index }}, {{ end }}{{ $author }}{{ end }} et al. {{ else }} {{ range $index, $author := . }}{{ if $index }}, {{ end }}{{ $author }}{{ end }} {{ end }} {{ end }}