How do you see all the methods from a template?

Hi there,

I tried Template Debugging | Hugo advice of putting {{ printf "%#v" . }} but it just shows some useless stuff like resource.Resources{(*resources.resourceAdapter)(0xc00007d360), (*resources.resourceAdapter)(0xc00007d450)}

I also tried using GitHub - kaushalmodi/hugo-debugprint: Hugo "debugprint.html" partial like so {{ partial "debugprint.html" . }}, which is better, but it doesn’t show the .Exif method!

So I am wondering, how do people see all the methods available on a template object please?

The documentation.

Ok, I file a bug for this feature. The documentation isn’t enough.

That issue will be closed as a double issue quite soon. There are plenty of them open with explanation that it’s hard to “debug” functions and methods. Get back here when that happens.

The documentation isn’t enough.

It’s open source. Help extending it. Add an entry for .Exif on the list and link to it’s subdocumentation.

You could use debugprint to debug something like $image.Exif instead of a dot.

1 Like