Skip to content
Permalink
Browse files
feat(syntax): add copy to clipboard button for every code snippet
Fix #574
Fix #525
  • Loading branch information
talha131 committed Feb 3, 2020
1 parent 07595b3 commit 6f733179b80d8225af71bc5945be1fddd98b40ae
Show file tree
Hide file tree
Showing 7 changed files with 1,283 additions and 7 deletions.
@@ -0,0 +1,20 @@
---
Title: Code Snippets -- Copy to Clipboard
Tags: code-snippets, gist, unique
Date: 2020-02-03 19:17
comments: false
Slug: code-snippets-copy-to-clipboard
authors: Talha Mansoor
Category: Components
---

Elegant is the only Pelican theme that comes with a "Copy To Clipboard" button
on every code snippet.

Try it out

```go
fmt.Println("Hello Clipboard")
```

We use excellent JavaScript library, [clipboard.js](https://clipboardjs.com/) for this feature. Your readers do not need Flash for this feature.
@@ -65,11 +65,11 @@ const watchFiles = () => {
"templates/**/*.html",
"static/**/*.css",
"static/**/*.less",
"!static/**/elegant.prod.css",
"static/**/*.js",
"!static/js/elegant.prod.js",
"!static/**/bootstrap.css",
"!static/**/bootstrap_responsive.css"
"!static/**/bootstrap_responsive.css",
"!static/**/elegant.prod.css",
"!static/js/elegant.prod.js"
],
{ ignoreInitial: false },
buildAll
@@ -91,6 +91,8 @@ const minifyJS = () => {
"static/photoswipe/photoswipe.js",
"static/photoswipe/photoswipe-ui-default.js",
"static/photoswipe/photoswipe-array-from-dom.js",
"static/clipboard/clipboard.js",
"static/js/copy-to-clipboard.js",
"!static/js/elegant.prod.js"
])
.pipe(concat("elegant.prod.js"))

0 comments on commit 6f73317

Please sign in to comment.