Skip to content

Commit

Permalink
Update template-debugging.md to include a jsonify example
Browse files Browse the repository at this point in the history
  • Loading branch information
finn-matti authored Jun 21, 2023
1 parent 22bca51 commit 897812a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions content/en/templates/template-debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ When developing a [homepage], what does one of the pages you're looping through
{{ end }}
```

In some cases it might be more helpful to use the following snippet on the current context to get a pretty printed view of what you're able to work with:

```go-html-template
<pre>{{ . | jsonify (dict "indent" " ") }}</pre>
```

Note that Hugo will throw an error if you attempt to use this construct to display context that includes a page collection (e.g., the context passed to home, section, taxonomy, and term templates).

## Why Am I Showing No Defined Variables?

Check that you are passing variables in the `partial` function:
Expand Down

0 comments on commit 897812a

Please sign in to comment.