hugo/tpl
Mathias Biilmann 2989c38245 tpl: Add truncate template function
This commit adds a truncate template function for safely truncating text without
breaking words. The truncate function is HTML aware, so if the input text is a
template.HTML it will be truncated without leaving broken or unclosed HTML tags.

    {{ "this is a very long text" | truncate 10 " ..." }}
    {{ "With [Markdown](/markdown) inside." | markdownify | truncate 10 }}
2017-01-06 10:42:32 +01:00
..
reflect_helpers.go Make where accept slice 2016-03-06 13:15:07 +01:00
template.go hugolib: Enable override of theme base template only 2016-12-15 21:35:38 +01:00
template_ast_transformers.go tpl: Fix params case issue with nested template funcs 2016-11-27 19:02:43 +01:00
template_ast_transformers_test.go tpl: Fix params case issue with nested template funcs 2016-11-27 19:02:43 +01:00
template_embedded.go tpl: Use HTTPS in Google Analytics template 2016-12-31 12:43:33 +01:00
template_func_truncate.go tpl: Add truncate template function 2017-01-06 10:42:32 +01:00
template_func_truncate_test.go tpl: Add truncate template function 2017-01-06 10:42:32 +01:00
template_funcs.go tpl: Add truncate template function 2017-01-06 10:42:32 +01:00
template_funcs_test.go tpl: Add truncate template function 2017-01-06 10:42:32 +01:00
template_i18n.go commands, hugolib, source, target, tpl: Get rid of some fmt statements 2016-11-22 23:43:55 +01:00
template_i18n_test.go tpl: Golint fixes 2016-11-05 17:28:14 +01:00
template_resources.go tpl: Simplify 2016-11-23 18:53:50 +01:00
template_resources_test.go tpl: Simplify 2016-11-23 18:53:50 +01:00
template_test.go Add readFile template func 2016-03-31 21:24:18 +02:00