# A Hugo 'debug table' module

**URL:** https://discourse.gohugo.io/t/a-hugo-debug-table-module/31858
**Category:** tips & tricks
**Created:** [March 20, 2021, 10:26am UTC](https://discourse.gohugo.io/t/a-hugo-debug-table-module/31858 "2021-03-20T10:26:02Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![cshoredaniel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cshoredaniel/32/19684_2.png) [@cshoredaniel](https://discourse.gohugo.io/u/cshoredaniel)
#### Post date: [March 20, 2021, 10:26am UTC](https://discourse.gohugo.io/t/a-hugo-debug-table-module/31858/1 "2021-03-20T10:26:02Z")

</div>

I got really inspired by this comment by @zwbetz:

> [@A theme for minimal reproducible test casing](https://discourse.gohugo.io/t/a-theme-for-minimal-reproducible-test-casing/31790/8):
>
> @cshoredaniel - Nice, I like minimal reproducible samples like this, they’re good for learning. Since others are throwing in ideas, this [debug table](https://github.com/zwbetz-gh/starter-hugo-debug-site/blob/master/layouts/partials/debug-table.html) has been useful to me in the past

I’ve now got a Hugo module (so others can easily incorporate into their themes from a canonical source, rather than the problem of copying the code as boilerplate and the associate divergence) that implements the original idea only, I think, better.

Hope you like it!

[https://github.com/danielfdickinson/hugoDebugTables](https://github.com/danielfdickinson/hugoDebugTables)

---

<div class="post-metadata">

### Author: ![cshoredaniel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cshoredaniel/32/19684_2.png) [@cshoredaniel](https://discourse.gohugo.io/u/cshoredaniel)
#### Post date: [March 25, 2021, 3:17pm UTC](https://discourse.gohugo.io/t/a-hugo-debug-table-module/31858/2 "2021-03-25T15:17:21Z")

</div>

FYI I’ve done a ‘bunch’ more work on this, and like the results. I’ve parameterized the the table generation so that hopefully it will be easier to add/remove fields as Hugo gains/loses variables. In addition I’ve added classes to the html elements and created a basic static CSS for testing. I think the test CSS actually improves the readability of nested tables (by ‘popping’ them up and enlarging when opened).

Hopefully I can now be satisfied enough with this that I actually get back to the theme I was originally working on…

---

<div class="post-metadata">

### Author: ![JugglerX](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jugglerx/32/8098_2.png) [@JugglerX](https://discourse.gohugo.io/u/JugglerX)
#### Post date: [April 7, 2021, 7:26am UTC](https://discourse.gohugo.io/t/a-hugo-debug-table-module/31858/3 "2021-04-07T07:26:53Z")

</div>

@cshoredaniel This looks really great!

I worked on something similar awhile back - [GitHub - JugglerX/hugo-debug-bar: Prototype debug bar for Hugo themes](https://github.com/JugglerX/hugo-debug-bar)

I have not looked at this in awhile, but maybe there will be something useful there.

---

<div class="post-metadata">

### Author: ![cshoredaniel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cshoredaniel/32/19684_2.png) [@cshoredaniel](https://discourse.gohugo.io/u/cshoredaniel)
#### Post date: [April 13, 2021, 12:39am UTC](https://discourse.gohugo.io/t/a-hugo-debug-table-module/31858/4 "2021-04-13T00:39:52Z")

</div>

> [@JugglerX](#):
>
> worked on something similar awhile back - [GitHub - JugglerX/hugo-debug-bar: Prototype debug bar for Hugo themes](https://github.com/JugglerX/hugo-debug-bar)
> 
> I have not looked at this in awhile, but maybe there will be something useful there.

Thank you, and sorry for taking so long to respond (I’m working on updating the exitwp-for-hugo Python script for Python 3 to move my WordPress sites to Hugo; the script also was rather dated and wasn’t doing everything I want). I’m definitely interested in taking a look to see if there is useful stuff there.

---

<div class="post-metadata">

### Author: ![cshoredaniel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cshoredaniel/32/19684_2.png) [@cshoredaniel](https://discourse.gohugo.io/u/cshoredaniel)
#### Post date: [July 18, 2021, 5:53pm UTC](https://discourse.gohugo.io/t/a-hugo-debug-table-module/31858/5 "2021-07-18T17:53:58Z")

</div>

So, much later than planned, I am circling back to Hugo tasks.

I have created a new

> **[danielfdickinson/hugo-debug-tables](https://github.com/danielfdickinson/hugo-debug-tables)**
>
> A Hugo module that adds a partial and shortcode for displaying most variables available on a page generated by Hugo - danielfdickinson/hugo-debug-tables

repository and will be pointing the old version at this version and archiving the old version.

I have done this because things got a little bollixed when tried to do my own git hosting, plus I got away from the minimal theme with my minimal test theme, so I’m reworking (and renaming) the various repositories which are, and will remain on, GitHub, for my hair’s sake (what’s left of it).

I have a much more minimalist demo now at [https://hugo-test-debug-tables.wildtechgarden.ca](https://hugo-test-debug-tables.wildtechgarden.ca), with source code in

> **[danielfdickinson/hugo-test-debug-tables](https://github.com/danielfdickinson/hugo-test-debug-tables)**
>
> A stripped down fork of gohugoio/hugoBasicExample for testing and demonstrating danielfdickinson/hugo-debug-tables - danielfdickinson/hugo-test-debug-tables

I apologize for the mess and any confusion. Hopefully the end result is useful and worth the effort.
