{{ $permalink_pretty := .Permalink | replaceRE "\\.html$" "/" }} {{- with $.Params.images -}} {{- $image := (index . 0) -}} {{ if (findRE "^/" $image) }} {{ $baseurl_no_trailing_slash := $.Site.BaseURL | replaceRE "/$" "" }} {{- else -}} {{- end -}} {{ else -}} {{- $images := $.Resources.ByType "image" -}} {{- $featured := $images.GetMatch "*feature*" -}} {{- $featured := cond (ne $featured nil) $featured ($images.GetMatch "{*cover*,*thumbnail*}") -}} {{- with $featured -}} {{- else -}} {{- with $.Site.Params.images -}} {{- $image := (index . 0) -}} {{ if (findRE "^/" $image) }} {{ $baseurl_no_trailing_slash := $.Site.BaseURL | replaceRE "/$" "" }} {{- else -}} {{- end -}} {{- end -}} {{- end -}} {{- end }} {{ with .Site.Social.twitter -}} {{ end -}}