-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "Copy to clipboard" button. #37
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good -- let's just add comments to the SVG files with the license.
fyi, |
@neersighted added licensing comments to SVGs |
Hi! I am not Abn, but I will try to answer. Biggest issue was that with current setup there was no good plugin for rollup to bundle SVG files with icons for the button. It looked ok on previews, but when we deployed it to production, it broke all JS on our website and that caused a lot of issues. Feel free to work on that feature. |
OK. I have to admit that I am completely novel to hugo and JS, but this might be a nice time to get started (low prio though). Do you have any thoughts on (1) how to proceed and, perhaps more importantly, (2) how to test (and actually fail) before production? |
This code allows for adding the "copy to clipboard" button using Hugo shortcodes. As not every code block needs to be copyable, the button will be added only to parts wrapped in
{{% clipboard %}} ... {{% /clipboard %}}
tags. After this is accepted and merged, I will prepare separate PR in the main repo, adding required tags to docs.How to preview
As docs files are not kept with website code, previewing requires some legwork. Checkout this PR, setup the website (as in README) and manually add required tags in downloaded docs files.