diff --git a/docs/content/templates/go-templates.md b/docs/content/templates/go-templates.md index 056f78e99..b2ce192b7 100644 --- a/docs/content/templates/go-templates.md +++ b/docs/content/templates/go-templates.md @@ -249,24 +249,47 @@ Alternatively, use the backtick (`` ` ``) to quote the IE conditional comments, ## Context (a.k.a. the dot) The most easily overlooked concept to understand about Go templates is that `{{ . }}` -always refers to the current context. In the top level of your template this -will be the data set made available to it. Inside of a iteration it will have -the value of the current item. When inside of a loop the context has changed. -`.` will no longer refer to the data available to the entire page. If you need +always refers to the current context. In the top level of your template, this +will be the data set made available to it. Inside of a iteration, however, it will have +the value of the current item. When inside of a loop, the context has changed: +`{{ . }}` will no longer refer to the data available to the entire page. If you need to -access this from within the loop, you will likely want to set it to a variable -instead of depending on the context. +access this from within the loop, you will likely want to do one of the following: -**Example:** +1. Set it to a variable instead of depending on the context. For example: - {{ $title := .Site.Title }} - {{ range .Params.tags }} -