mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-14 13:54:43 -04:00
tpl: Add humanize func and cleanup lint
Add humanize (inflect.Humanize) to the template funcMap. Documentation and tests are included. Various code cleanups of the template funcs: - Break pluralize and singularize out into stand-alone funcs. - Sort the list of funcMap entries. - Add some minimal godoc comments to all public funcs. - Fix some issues found by golint and grind.
This commit is contained in:
parent
25be260389
commit
bc5e2d841f
@ -387,6 +387,16 @@ Takes a string of code and a language, uses Pygments to return the syntax highli
|
||||
Used in the [highlight shortcode](/extras/highlighting/).
|
||||
|
||||
|
||||
### humanize
|
||||
Humanize returns the humanized version of a string with the first letter capitalized.
|
||||
|
||||
e.g.
|
||||
```
|
||||
{{humanize "my-first-post"}} → "My first post"
|
||||
{{humanize "myCamelPost"}} → "My camel post"
|
||||
```
|
||||
|
||||
|
||||
### lower
|
||||
Converts all characters in string to lowercase.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user