The Hugo Template Inspector is a helper template that prints all template variables in a modal.
You should NOT use this utility on a site that is acessible to the public. This utility prints a lot of data about your site and server. Some of which could pose security risks if the data were accessible to nefarious individuals (about half of the internet).
ಠ_ಠ
This utility is intended to be used by developers who are creating or modifying Hugo templates.
HTI was built while using Hugo v0.64.1
. Compatibility with other versions is not currently known.
Copy the inspector.html
into your partials directory. The partials directory can be located under the layouts directory either under the main site root, or within your theme. The following is where this file lives on my particular installation. Your exact loction will likely be different:
/Users/username/Sites/websitedir/themes/mycustomtheme/layouts/partials/inspector.html
Once the inspector.html file is in place, you'll need to paste the following somewhere in your baseof.html
template:
{{- partial "inspector.html" . -}}
I usually put that directly under the opening <body>
tag.
On a Linux or Mac system, you can find your baseof.html
template with the following command:
find ~ -name baseof.html 2> /dev/null
With that file installed, start your Hugo server with the following command:
hugo server -D
Then browse to your site at:
http://localhost:1313
And finally activate the modal by pressing the q
key.
To hide the modal, press the q
key again.