I spent some time today working on a “debug bar” for my Hugo themes.
I posted earlier in another thread some thoughts about why I think this kind of tooling would be beneficial to Hugo Printing template lookup order and chosen template - I could elaborate further if needed.
Much of the logic for printing the hugo variables is taken from here - https://github.com/kaushalmodi/hugo-debugprint/blob/master/layouts/partials/debugprint.html
Currently the main issue, is that to display the currently chosen template, you must manually declare and pass the template name as an argument to the debug partial. And you must do this from within each layout file. This means that this solution requires a non trivial amount of setup work. It’s also a solution that is implemented at the theme layer, rather than a core feature of Hugo.
My hope would be that this could form the basis and inspiration for further work into a core debug bar for Hugo.