jlongster/nunjucks — pull request #58 by devoidfury (2013-02-11 18:41:43+00:00)
Title: Truncate filter

Args are the same as jinja2: `(input, length, killwords, end)`

`length` defaults to 255.

`killwords` (default: `false`) -- if `true`, will not try to split on words. If `false`, it will split on words and it will try to save the last word.

`end` (default: `...`) -- If `input` is truncated, append this string to the end.

Note: `length` does not account for the length of `end`.