mirror of
https://github.com/gohugoio/hugo.git
synced 2025-01-30 17:42:41 +00:00
2989c38245
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 }} |
||
---|---|---|
.. | ||
reflect_helpers.go | ||
template.go | ||
template_ast_transformers.go | ||
template_ast_transformers_test.go | ||
template_embedded.go | ||
template_func_truncate.go | ||
template_func_truncate_test.go | ||
template_funcs.go | ||
template_funcs_test.go | ||
template_i18n.go | ||
template_i18n_test.go | ||
template_resources.go | ||
template_resources_test.go | ||
template_test.go |