{{ $perm := .Permalink }} {{ $base := .Site.BaseURL }} {{ $logo := "img/logo.png" }} {{ $isHomePage := eq .Title .Site.Title }} {{ if .Params.subtitle }} {{ else }} {{ if .Summary }} {{ else }} {{ end }} {{ end }} {{ if .Keywords }} {{ else if .Params.tags }} {{ end }} {{ $thumb := $logo | absURL }} {{ if .Params.bigimg }} {{- $image := resources.Get (printf "%s%s" "bigimg/" .Params.bigimg ) -}} {{ if eq $image nil }} {{ else }} {{- $imgsmall := $image.Resize "768x jpg q70" }} {{ $thumb = $imgsmall.Permalink }} {{- $imgmedium := $image.Resize "960x jpg q85" }} {{ end }} {{ else }} {{ $match := findRE `!\[(.*)\]\((.+).(jpg|png|gif)` .RawContent 1 }} {{ range $match }} {{ $relthumb := replaceRE `!\[(.*)\]\(` "" . }} {{ if hasPrefix $relthumb "/" }} {{ $thumb = printf "%s%s" $base $relthumb }} {{ else }} {{ $thumb = printf "%s%s" $perm $relthumb }} {{ end }} {{ end }} {{ end }} {{ if .Params.subtitle }} {{ else }} {{ end }} {{ $related := first 3 (where (where (where .Site.Pages.ByDate.Reverse ".Type" "==" "post") ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" $perm) }} {{ if $related }} {{ range $related }} {{ end }} {{ end }} {{ with .Params.tags }}{{ range first 6 . }} {{ end }}{{ end }} {{ $ISO8601 := "2006-01-02T15:04:05-07:00" }}