{{ $.Scratch.Set "bl_lang" false }} {{ $.Scratch.Set "bl_author" false }} {{ $.Scratch.Set "bl_source" false }} {{ $.Scratch.Set "bl_link" false }} {{ $.Scratch.Set "bl_title" false }} {{ if .IsNamedParams }} {{ $.Scratch.Set "bl_lang" (.Get "lang") }} {{ $.Scratch.Set "bl_author" (.Get "author") }} {{ $.Scratch.Set "bl_source" (.Get "source") }} {{ $.Scratch.Set "bl_link" (.Get "link") }} {{ $.Scratch.Set "bl_title" (.Get "title") }} {{ else }} {{ end }} {{ with $.Scratch.Get "bl_title" }} {{ else }} {{ with $.Scratch.Get "bl_link" }} {{ range last 1 (split ($.Scratch.Get "bl_link" ) "://") }} {{ $.Scratch.Set "title_without_protocol" . }} {{ end }} {{ range last 1 (split ($.Scratch.Get "title_without_protocol" ) "www.") }} {{ $.Scratch.Set "title_without_protocol" . }} {{ end }} {{ $.Scratch.Set "bl_title" ($.Scratch.Get "title_without_protocol") }} {{ if (gt (len ($.Scratch.Get "title_without_protocol") ) 32) }} {{ $title := (slicestr ($.Scratch.Get "title_without_protocol") 0 32) }} {{ $split_by_fw_slash := split $title "/" }} {{ $count := (sub (len $split_by_fw_slash) 1) }} {{ $.Scratch.Set "tempstring" "" }} {{ range first $count $split_by_fw_slash }} {{ $.Scratch.Set "tempstring" ( . | printf "%s%s/" ($.Scratch.Get "tempstring") | printf "%s" ) }} {{ end }} {{ $.Scratch.Set "bl_title" ( printf "%s..." ($.Scratch.Get "tempstring") | printf "%s" ) }} {{ end }} {{ end }} {{ end }}
{{ .Inner | markdownify | safeHTML -}} {{ with $.Scratch.Get "bl_author" -}}
{{ with $.Scratch.Get "bl_author" -}}{{ . }}{{ end }} {{ with $.Scratch.Get "bl_source" }} — {{ . }} {{ else }} {{ with $.Scratch.Get "bl_link" }} — {{ $.Scratch.Get "bl_title" }} {{ else }} {{ with $.Scratch.Get "bl_title" }} — {{ $.Scratch.Get "bl_title" }} {{ end }} {{ end }} {{ end }}
{{- end -}}