Commit graph

13 commits

Author SHA1 Message Date
susiwen8
bf55afd71f
Fix some humanize issues
Fixes #7912
2021-02-14 18:30:59 +01:00
Bjørn Erik Pedersen
d90e37e0c6 all: Format code with gofumpt
See https://github.com/mvdan/gofumpt
2020-12-03 13:12:58 +01:00
Bjørn Erik Pedersen
9e57182705
tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
Cameron Moore
30a7c9ea37 tpl: Add godoc packages comments
Also fix package name in tpl/templates.
2018-11-30 08:56:30 +01:00
Bjørn Erik Pedersen
e7652180a1
vendor: Fix Humanize for multi-byte runes
Fixes #4133
2017-11-28 21:16:01 +01:00
Jorin Vogel
09907d36af Switch from fork bep/inflect to markbates/inflect
Original package has received updates the fork hasn't.
Without fork updates are easier to maintain.
2017-08-01 13:05:09 +02:00
Bjørn Erik Pedersen
d8717cd4c7 all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
Bjørn Erik Pedersen
1f9e8dcc60 tpl: Make the Namespace func signature explicit
This makes it cleaner and avoids breaking client code, such as the docs helper JSON generator.
2017-05-20 11:34:38 +03:00
Cameron Moore
f69df916df tpl: Add basic tests for all namespace init funcs 2017-05-02 00:07:33 +02:00
Bjørn Erik Pedersen
690b0f8ff5 tpl: Add docshelper for template funcs
And fix some other minor related issues.

Updates #3418
2017-05-01 21:44:15 +02:00
Bjørn Erik Pedersen
0e2260421e tpl: Fix the remaining template funcs namespace issues
See #3042
2017-05-01 15:13:41 +02:00
Bjørn Erik Pedersen
fc77b6303c tpl/inflect: Make it a package that stands on its own
See #3042
2017-05-01 15:13:41 +02:00
Cameron Moore
de7c32a1a8 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
2017-04-30 10:56:38 +02:00