A recent update to the Zen theme (@frjo) added a copy code button to code blocks via a code block render hook (render-codeblock.html). It works great! Thanks. However, I have a couple of code blocks that have line numbering enabled, but the line numbers are not being displayed.
Can anyone suggest how to upgrade the code block render hook with line number support? Thanks.
(I am currently rebuilding my site with the Zen theme at my staging site.)
I only have a couple of code blocks that have line numbers enabled. I have been debating with myself if I really need or want line numbers. For now, I am going to disable line numbers. I really like how the new render codeblock hook works.
For anyone else stumbling across this, you can also use JS to add copy buttons to code blocks without a code block render hook. We do this on Hugo’s documentation site.
git clone --single-branch -b hugo-forum-topic-49633 https://github.com/jmooring/hugo-testing hugo-forum-topic-49633
cd hugo-forum-topic-49633
npm ci
hugo server