-
Notifications
You must be signed in to change notification settings - Fork 614
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 code button #963
Add copy code button #963
Conversation
✅ Deploy Preview for toha-ci ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi @BernatBC! I will review on the weekend. Giving a quick look on the deploy preview, I noticed these:
You can follow the GitHub style. Also, we need to think about where to put the configuration. It will be better to unify all markdown related configurations under a single section. |
Hi @hossainemruz,
|
Awesome. Thank you. I will take a look soon. |
Signed-off-by: hossainemruz <[email protected]>
@BernatBC I have updated the button look and also added some feedback on click. Let me know how does it feel now. |
Hi @hossainemruz, |
@BernatBC I was wondering if we should combine these kind of feature configurations under common section? That will make them easily discover-able. For example: params:
features:
utility: # not sure what should be the name. feel free to suggest
copyCodeButton:
enable: true # add a button to copy code on a code blocks. default "true"
readingTime:
enable: true # show estimated reading time on reading page. default: "true" Maybe few other settings can go there too. |
Looks good to me, but will need to be careful with this change, as it will introduce breaking changes for "readingTime" |
Keeping as it is now. If we want to group them under utility section, the configuration will be: params:
features:
utility:
enabled: true
services:
copyCodeButton:
enable: true # add a button to copy code on a code blocks. default "true"
readingTime:
enable: true # show estimated reading time on reading page. default: "true" The utility functions does not have anything in common. So, it does not make sense to put them under same service. |
Signed-off-by: hossainemruz <[email protected]>
Thanks 💯 |
Issue
Description
Adds a copy code button in all code blocks. To enable this feature, you'll need to add the following lines into
config.yaml
/hugo.yaml
:I will add this into hugo-toha/hugo-toha.github.io and hugo-toha/guides
Test Evidence