From 35abbc869199b852922c024a29e2370272a7c1c8 Mon Sep 17 00:00:00 2001 From: Ron Liskey Date: Sat, 5 Aug 2017 13:03:19 -0700 Subject: [PATCH] Add example with taxonomy for title template func Example URL with printf. --- content/functions/title.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/functions/title.md b/content/functions/title.md index 3ecf1ac34..d65552178 100644 --- a/content/functions/title.md +++ b/content/functions/title.md @@ -23,3 +23,11 @@ aliases: [] ``` {{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 }} +
  • {{ $name | humanize | title }} ({{ len $items }})
  • +{{ end }} +```