diff --git a/docs/content/templates/go-templates.md b/docs/content/templates/go-templates.md index adb1ae3c9..86555fd8f 100644 --- a/docs/content/templates/go-templates.md +++ b/docs/content/templates/go-templates.md @@ -144,6 +144,10 @@ range. {{ $element }} {{ end }} +The `index` function is a [Go][] built-in, and you can read about it [here][gostdlibpkgtexttemplate]. `index`: + +> ...returns the result of indexing its first argument by the following arguments. Thus "index x 1 2 3" is, in Go syntax, `x[1][2][3]`. Each indexed item must be a map, slice, or array. + ### Conditionals `if`, `else`, `with`, `or` & `and` provide the framework for handling conditional @@ -383,10 +387,6 @@ so, such as in this example: ``` - -[go]: http://golang.org/ -[gohtmltemplate]: http://golang.org/pkg/html/template/ - # Template example: Show only upcoming events Go allows you to do more than what's shown here. Using Hugo's @@ -406,3 +406,7 @@ the future: {{ end }} {{ end }} + +[go]: http://golang.org/ +[gohtmltemplate]: http://golang.org/pkg/html/template/ +[gostdlibpkgtexttemplate]: http://golang.org/pkg/text/template/