Skip to content
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 for code snippets #977

Closed
eljhkrr opened this issue Mar 7, 2023 · 2 comments
Closed

Add copy to clipboard button for code snippets #977

eljhkrr opened this issue Mar 7, 2023 · 2 comments
Assignees

Comments

@eljhkrr
Copy link
Member

eljhkrr commented Mar 7, 2023

While going through the v4 setup guide, I had to manually copy text blocks containing shell commands:
image
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:
image
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/

@eljhkrr
Copy link
Member Author

eljhkrr commented Apr 13, 2024

@esthermmoturi
Copy link
Contributor

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants