Need help with code blocks

I still don’t see an answer to this question. Can I use GitHub flavored markdown? CommonMark is not the same. IF this is possible, can someone detail how to set it up?

Specifically, I would like my code blocks to look like GitHub, with line numbers and a copy button. Am I missing something?

Enable line numbers in your site configuration. For example, with config.toml:

[markup.highlight]
lineNos = true

See https://gohugo.io/getting-started/configuration-markup#highlight

Use JS to add a copy button:
https://www.google.com/search?q=add+copy+button+to+code+block

2 Likes