jekyll-theme-centos 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/page/code-header.html +4 -0
- data/_layouts/default.html +1 -0
- data/_sass/centos/_mixins.scss +1 -0
- data/_sass/centos/mixins/_code-header.scss +47 -0
- data/_sass/centos/mixins/_content.scss +1 -0
- data/assets/js/copycode.js +17 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27f828d8ef0af0325b4b9d2c40feef81d414bb3712a7c7c37fd5aefda4a7904b
|
4
|
+
data.tar.gz: 11e18543e0b7210023a7524e5407afa7b95ed7c21497a2091dad647bbc372654
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bbb77c8c4a14bd8febc828b03f02dae1af36c14b43c0253e3bbf84bc8da7d1f586d721492b32efcd010962ecceae96a3986b567b97361d0d8605271b217e3c3
|
7
|
+
data.tar.gz: 5128068a4ad8532b86e24130a5e876878f74da7eb71d393bbc996694086a871bec3fb304853ba1a2217a305df99e036c7e221da13db369d9c760ed89c34b59ae
|
data/_layouts/default.html
CHANGED
data/_sass/centos/_mixins.scss
CHANGED
@@ -0,0 +1,47 @@
|
|
1
|
+
@mixin code-header {
|
2
|
+
|
3
|
+
.code-header {
|
4
|
+
display: flex;
|
5
|
+
justify-content: flex-end;
|
6
|
+
background: $black;
|
7
|
+
}
|
8
|
+
|
9
|
+
.copy-code-button {
|
10
|
+
display: grid;
|
11
|
+
grid-auto-flow: column;
|
12
|
+
align-items: center;
|
13
|
+
grid-column-gap: 4px;
|
14
|
+
border: none;
|
15
|
+
cursor: pointer;
|
16
|
+
background: $black;
|
17
|
+
color: $white;
|
18
|
+
font-size: small;
|
19
|
+
opacity: 0.7;
|
20
|
+
|
21
|
+
&:hover {
|
22
|
+
opacity: 0.85;
|
23
|
+
}
|
24
|
+
|
25
|
+
&:before {
|
26
|
+
@extend .fas;
|
27
|
+
content: fa-content($fa-var-clipboard);
|
28
|
+
}
|
29
|
+
&:after {
|
30
|
+
content: "Copy";
|
31
|
+
display: block;
|
32
|
+
}
|
33
|
+
|
34
|
+
// This class will be toggled via JavaScript
|
35
|
+
&.copied {
|
36
|
+
opacity: 1;
|
37
|
+
&:before {
|
38
|
+
@extend .fas;
|
39
|
+
content: fa-content($fa-var-check);
|
40
|
+
color: $green;
|
41
|
+
}
|
42
|
+
&:after {
|
43
|
+
content: "Copied!";
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
// Thanks Aleksandr
|
2
|
+
// https://www.aleksandrhovhannisyan.com/blog/how-to-add-a-copy-to-clipboard-button-to-your-jekyll-blog/
|
3
|
+
const codeBlocks = document.querySelectorAll(".code-header + .highlighter-rouge");
|
4
|
+
const copyCodeButtons = document.querySelectorAll(".copy-code-button");
|
5
|
+
|
6
|
+
copyCodeButtons.forEach((copyCodeButton, index) => {
|
7
|
+
const code = codeBlocks[index].innerText;
|
8
|
+
|
9
|
+
copyCodeButton.addEventListener("click", () => {
|
10
|
+
window.navigator.clipboard.writeText(code);
|
11
|
+
copyCodeButton.classList.add("copied");
|
12
|
+
|
13
|
+
setTimeout(() => {
|
14
|
+
copyCodeButton.classList.remove("copied");
|
15
|
+
}, 2000);
|
16
|
+
});
|
17
|
+
});
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-theme-centos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alain Reguera Delgado
|
@@ -97,6 +97,7 @@ files:
|
|
97
97
|
- _includes/page/alert-info.html
|
98
98
|
- _includes/page/alert-success.html
|
99
99
|
- _includes/page/alert-warning.html
|
100
|
+
- _includes/page/code-header.html
|
100
101
|
- _includes/page/figure.html
|
101
102
|
- _includes/page/video.html
|
102
103
|
- _includes/post-nav-explorer.html
|
@@ -217,6 +218,7 @@ files:
|
|
217
218
|
- _sass/centos/centos.scss
|
218
219
|
- _sass/centos/fonts/_montserrat.scss
|
219
220
|
- _sass/centos/mixins/_aside-nav.scss
|
221
|
+
- _sass/centos/mixins/_code-header.scss
|
220
222
|
- _sass/centos/mixins/_content-nav.scss
|
221
223
|
- _sass/centos/mixins/_content.scss
|
222
224
|
- _sass/centos/mixins/_link-list.scss
|
@@ -335,6 +337,7 @@ files:
|
|
335
337
|
- assets/img/post.png
|
336
338
|
- assets/js/bootstrap.min.js
|
337
339
|
- assets/js/bootstrap.min.js.map
|
340
|
+
- assets/js/copycode.js
|
338
341
|
- assets/js/dataTables.bootstrap4.min.js
|
339
342
|
- assets/js/instantsearch.min.js
|
340
343
|
- assets/js/jquery.dataTables.min.js
|