How to find the template part that rendered a piece of content?

Is there an elegant way to find the template part that is rendering a piece of content?

I always add something like ‘HELLO’ in the template and then look at how Hugo renders the page on localhost. :slightly_smiling_face:

That’s about as elegant as I can think of. :man_facepalming:

(I don’t know of way to have Hugo print out this information.)

The hugo CLI option --templateMetrics lists all the templates that are used to build the site, and the number of times each one runs.

It will at least show you all the templates that are being called, so you could move all but the one piece of content you are interested in testing, and run hugo then see all the templates that were called.

Not as elegant as you probably want, but a start.