Add debugging steps for no variables defined
authorDaniel Compton <desk@danielcompton.net>
Sat, 12 Mar 2016 08:44:50 +0000 (21:44 +1300)
committerDaniel Compton <desk@danielcompton.net>
Sat, 12 Mar 2016 08:44:50 +0000 (21:44 +1300)
docs/content/templates/debugging.md

index dac00540e8a1235ae5b226e6c0be54ee1f6f4311..c9af2a3ce8107e44bbb932ef25d573038dce974a 100644 (file)
@@ -54,3 +54,17 @@ you're looping through look like?
     {{ printf "%#v" . }}
 {{ end }}
 ```
+
+### Why do I have no variables defined?
+
+Check that you are passing variables in the `partial` function. For example
+
+```
+{{ partial "header" }}
+```
+
+will render the header partial, but the header partial will not have access to any variables. You need to pass variables explicitly. For example:
+
+```
+{{ partial "header" . }}
+```