Add example with taxonomy for title template func

Example URL with printf.
This commit is contained in:
Ron Liskey 2017-08-05 13:03:19 -07:00 committed by digitalcraftsman
parent 85e28c10ea
commit 35abbc8691

View File

@ -23,3 +23,11 @@ aliases: []
``` ```
{{title "BatMan"}}` → "Batman" {{title "BatMan"}}` → "Batman"
``` ```
Can be combined in pipes. In the following snippet, the link text is cleaned up using `humanize` to remove dashes and `title` to convert the value of `$name` to Intial Caps.
```
{{ range $name, $items := .Site.Taxonomies.categories }}
<li><a href="{{ printf "%s/%s" "categories" ($name | urlize | lower) | absURL }}">{{ $name | humanize | title }} ({{ len $items }})</a></li>
{{ end }}
```