Highlight: how to not add 'Copy' button automatically

Hi! I want to not add the “Copy” button (and associated Javascript) that is added automatically after code fences. How can I do that? (I know how to remove it with Javascript, but not adding it at all is far better.)

My reasons to not add it:

  1. Its text seems to be hardcoded, so I can’t use i18n (my site is in pt-BR).
  2. I don’t want it anyway.

Searching in documentation in Syntax highlighting and in Configure Markup I can’t find any mention to this button… Am I missing something?

I’m using Hugo 0.60, which uses Goldmark and highlights code fences automatically. Also, it’s the first time I use syntax highlighting with Hugo, so I don’t know if this behavior happened before 0.60.

Thank you!

@jzeneto
I don’t think it’s a built-in feature of Hugo (any version) to add “Copy” button to the code fences.
Are you using a specific theme or other JavaScript library for syntax highlighting?

1 Like

@jkboxomine you’re right! I’m using Hermit theme. I just re-read its readme, and it says “All code fields feature syntax highlighting and a code-copy function”…

Thank you, and sorry for the noise.

1 Like