A repo to try to figure out how to add a copy button to code snippets on GitPages. On github when using code snippet blocks there is automatically a copy button added.
Example: code snippet
However when this converted to Gitpages this feature dissapears giving rise to the aims of this repo.
- Add functional Copy Button.
- Format Copy Button.
- Make it deployable on any Gitpages website.
Following the tutorial found here this is the result.
{% include codeHeader.html %}
code goes in here!
It doesn't seem to be copying That tutorial doesn't seem to however the website it uses seems to used a more advanced copy button so I am going to try to recreate it from the source files of this website.
<div class="code-header">
<button class="copy-code-button">
Copy code to clipboard
</button>
</div>
The CSS code for the copy buttons is here.
The Javascript file is here.
Which seems to be dependent on this file here.