Import as a Hugo module
hugo mod get github.com/clondon/hugo-debug-utils
Add in your template.
{{- partial "debug/debug.html" (dict "context" .) -}}
If you need the template information, in each template provide
{{- partial "debug/debug.html" (dict "context" . "template" "layouts/<your template location>") -}}
For printing to JavaScript console while development:
{{ partial "console" $someVariable }}
- Based on JugglerX's debug bar - https://github.com/JugglerX/hugo-debug-bar
- Which includes Kaushal modi's debug print - https://github.com/kaushalmodi/hugo-debugprint
- Based on Scherb's helper - https://discourse.gohugo.io/t/easier-debugging-hugo-variables-using-the-javascript-console/22873