cncf / hugo-netlify-starter

Static website template for CNCF projects
https://cncf-hugo-starter.netlify.com/
Other
26 stars 16 forks source link

add copy code button to code blocks #97

Closed kapunahelewong closed 2 years ago

kapunahelewong commented 2 years ago

Add a copy code button to code blocks if a browser supports the functionality.

This code is kindly shared under the MIT License by Tom Spencer in their most excellent tutorial.

Screen Shot 2021-07-26 at 3 28 40 PM

Copy button changed to "Copied!" as confirmation.

Also adds some samples to the demo page.

nate-double-u commented 2 years ago

Nice addition!

I've tested using: MacOS

Ubuntu

/lgtm

[edited to remove DCO comment.]