truncate
Syntax
truncate SIZE INPUT
truncate SIZE ELLIPSIS INPUT
Since Go templates are HTML-aware, truncate
will intelligently handle normal strings vs HTML strings:
{{ "<em>Keep my HTML</em>" | safeHTML | truncate 10 }}` → <em>Keep my …</em>`
truncate SIZE INPUT
truncate SIZE ELLIPSIS INPUT
Since Go templates are HTML-aware, truncate
will intelligently handle normal strings vs HTML strings:
{{ "<em>Keep my HTML</em>" | safeHTML | truncate 10 }}` → <em>Keep my …</em>`