Adding a button to show and hide code block

Whenever I insert ``` code embedding, I want to add a simple button to show or hide the block.

How can I add this function?

Probably some Javascript/CSS combo. Please search elsewhere for that kind of knowledge. These forums are for Hugo-specific support. :slight_smile:

I can make a hide-show button by javascript using custom shortcode. But I want to modify the default mechanism for ``` code block. I am not sure where I have to modify.

Using three backticks for code is called “code fencing”, and the marks are “code fences”. That should help you figure out where to change that, please use the search on these forums and abroad.

Okay, thank you very much!