Newer
Older
{{ $length := cond (eq .length 0) 0 (default 150 .length) }}
{{ if gt $length 0 }}
{{ $text = replace $text "<" " <" }}
{{ $text = chomp (truncate $length "…" (safeHTML (plainify $text))) }}
{{ $length := cond (eq .length 0) 0 (default 150 .length) }}
{{ if gt $length 0 }}
{{ $text = replace $text "<" " <" }}
{{ $text = chomp (truncate $length "…" (safeHTML (plainify $text))) }}