Copy Code Button is a Publii plugin that adds a copy-to-clipboard button to every code
block in your posts and pages. The button appears on hover and shows a brief
confirmation after copying. It uses the browser's navigator.clipboard API.
- Copy-to-clipboard button on every code block in posts and pages
- Button appears on hover
- Confirmation after a successful copy
- Configurable confirmation text (default
Copied!) - Configurable confirmation duration in milliseconds (default
2000) - Configurable scope: posts and pages, posts only, or pages only
Publii 0.43.0 or newer.
- Download the release ZIP.
- Publii -> Tools -> Plugins -> Install plugin -> pick the ZIP.
- Enable the plugin for the site.
Open Plugins -> Copy Code Button -> settings icon. Set the confirmation text and duration, and choose whether the button applies to posts and pages, posts only, or pages only. Rebuild the site; hover any code block to reveal the copy button.
Feel free to fork this project or contribute a PR. Build instructions can be found in the developer readme DEV.md.
This project is licensed under the GPLv3+. See LICENSE file for details.
None, the plugin is self-contained plain JavaScript with no dependencies.
This project was developed by InPoint Automation Sp. z o.o. https://inpointautomation.com/
Thanks to the Publii project for the CMS and plugin API.
See CHANGELOG.md for the full version history.
