truncate_html

Signature
x | truncate_html(length=, ellipsis=?)

Go’s HTML-aware truncate: closes open tags, ellipsis default …. Keeps the input’s safety.

Arguments#

ArgumentTypeRequired
lengthintyes
ellipsisstringno

Details#

  • Kind: Filter, implemented by fugo.
  • Available in: every kind of template: layouts, partials, shortcodes and render hooks.
  • Output: escaped like any value, unless marked safe.

    Type to search titles, headings and text.