mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Add debugging steps for no variables defined
This commit is contained in:
@@ -54,3 +54,17 @@ you're looping through look like?
|
|||||||
{{ printf "%#v" . }}
|
{{ printf "%#v" . }}
|
||||||
{{ end }}
|
{{ 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" . }}
|
||||||
|
```
|
||||||
|
Reference in New Issue
Block a user