Closed eljhkrr closed 1 week ago
While going through the v4 setup guide, I had to manually copy text blocks containing shell commands: It would be very useful if users could have a copy to clipboard button to grab the whole set of commands at a go like in the example below: There are a number of workarounds both in the hugo ecosystem and using vanilla JS that can be adopted to add this functionality. A few examples: https://digitaldrummerj.me/hugo-add-copy-code-snippet-button https://www.dannyguo.com/blog/how-to-add-copy-to-clipboard-buttons-to-code-blocks-in-hugo/
Copy code snippet is available in docsy v0.6.0+ https://github.com/google/docsy/pull/1447 https://www.docsy.dev/docs/adding-content/lookandfeel/#code-highlighting-with-chroma
Done!
While going through the v4 setup guide, I had to manually copy text blocks containing shell commands: It would be very useful if users could have a copy to clipboard button to grab the whole set of commands at a go like in the example below: There are a number of workarounds both in the hugo ecosystem and using vanilla JS that can be adopted to add this functionality. A few examples: https://digitaldrummerj.me/hugo-add-copy-code-snippet-button https://www.dannyguo.com/blog/how-to-add-copy-to-clipboard-buttons-to-code-blocks-in-hugo/