How can I display a title caption for a code block?

Hello, occasionally, it would be helpful to be able to display a title caption above/below a code block so that my readers know which file the code block refers to. Based on the documentation, it seems like this should be easy to do by setting the options full=True and title=‘code title’, but I can’t seem to get it to work.

I am using the following highlight shortcode:

{{< highlight go "full=True,title='code.go'" >}}
func main() {
	fmt.Println("Hello world")
}
{{< / highlight >}}

The code block gets rendered correctly, but the title caption is not shown, and I don’t see the title anywhere when I view source, so it doesn’t seem to be hidden due to CSS.

I am using Chroma for highlighting, but based on the documentation, the ‘full’ and ‘title’ options from pygments should be supported.

Any input on how to get this to work would be greatly appreciated. Thank you for your help!

I cannot be sure, but it might be the case that the text you’re looking at, is just from the original doc, and was not edited much when Hugo moved to Chroma. It does appear to say that those are all supported, but, it also points at the pygments doc for details.

Maybe experiment? :

{{< highlight go "full=True,title=oneword" >}}
{{< highlight go "full=True,title="title in double quotes"" >}}