I made a wrapper around this debug-hugo partial from kaushalmodi

To turn it on, set enabledebugpanel = true in front matter or add the same variable to the site params in hugo.toml.