I am using Hugo to generate my static site. I have to inspect the value of a variable in Hugo to make sure I get expected results. Consider the following in index.html:
{{ $pages := .Pages }} <body> <div> {{ $pages }} </div> </body> What I get is:
Pages(3) But what I want is to see the full serialized value of the object. How to achieve it?
Attempts
I have tried:
<div> {{ print $pages }} </div> However still the same.
1 Answer
You have printf available, so you can try
{{ printf "%#v" $pages }}