shithub: hugo

Download patch

ref: de7c32a1a880820252e922e0c9fcf69e109c0d1b
parent: 154e18ddb9ad205055d5bd4827c87f3f0daf499f
author: Cameron Moore <moorereason@gmail.com>
date: Mon Mar 13 13:55:02 EDT 2017

tpl: Add template function namespaces

This commit moves almost all of the template functions into separate
packages under tpl/ and adds a namespace framework.  All changes should
be backward compatible for end users, as all existing function names in
the template funcMap are left intact.

Seq and DoArithmatic have been moved out of the helpers package and into
template namespaces.

Most of the tests involved have been refactored, and many new tests have
been written.  There's still work to do, but this is a big improvement.

I got a little overzealous and added some new functions along the way:

- strings.Contains
- strings.ContainsAny
- strings.HasSuffix
- strings.TrimPrefix
- strings.TrimSuffix

Documentation is forthcoming.

Fixes #3042