jekyll-theme-centos 0.5.1 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8bf39e464cb6a246a1ad2f65fcfe940c021cece91ed825ee30dd46156fa6cac8
4
- data.tar.gz: 946436eca51a68284388ff2935c2085828cfaf846eb7e205636b9435eca16c8e
3
+ metadata.gz: 38e2c82abcca2f4a190afa49488fff2a6867968f3a6ec4f0734eeb074b58b1df
4
+ data.tar.gz: 1a62c27359772f4a7dd8ac25bd94d8dcf9ac7768c2caae3b12bd456c86928737
5
5
  SHA512:
6
- metadata.gz: e2449152531261982d3e586d0f8203d2911dddb916debb7869e98f6b4f1748c84cd830feae41d134d8cbd8bca2e07118a9cdf96c6ce76d643bfd9dbc7597fbd6
7
- data.tar.gz: 2fef55c62f06a42787a62047239793298491503d5643601d5d9aa0929b407699194efb315dd64d7e50aa0171fbbf9423eb0ef44785bc1ac316d120ccc0bb1b20
6
+ metadata.gz: c7de46e856028d61291c0944f36295a09ea0ddf18714d8b674761da7c56ec1f49f8757ffad724a1a4ed0ad9cefcd9b267a32604802779a7bb86b71e107cfb246
7
+ data.tar.gz: f63edff0aa3c155855a9e1c4c6264b9c9d8d21328200ef15c8b03c97e039c95a29813596fe5e6df10cee850dbc73cd61c4afe9cb8bf43233750fa144bf146cdf
@@ -0,0 +1,4 @@
1
+ <div class="code-header">
2
+ <button class="copy-code-button" aria-label="Copy code to clipboard"></button>
3
+ </div>
4
+
@@ -14,6 +14,7 @@
14
14
 
15
15
  <script src="/assets/js/jquery.min.js"></script>
16
16
  <script src="/assets/js/bootstrap.min.js"></script>
17
+ <script src="/assets/js/copycode.js"></script>
17
18
  </body>
18
19
 
19
20
  </html>
@@ -10,6 +10,7 @@
10
10
  &__distributions {
11
11
  .btn {
12
12
  @extend .btn-primary;
13
+ width: 100%;
13
14
  margin-right: 15px;
14
15
  margin-bottom: $paragraph-margin-bottom;
15
16
  }
@@ -115,32 +116,34 @@
115
116
  }
116
117
 
117
118
  .search {
118
- @include content;
119
+ &__content {
120
+ @extend .col-sm-12;
121
+ @include content;
119
122
 
120
- .ais-search-box {
121
- max-width: 100%;
122
- margin-bottom: 15px;
123
- }
124
- .ais-hits {
125
- @include link-list;
126
- }
127
- .ais-pagination {
128
- li {
129
- text-decoration: none;
123
+ .ais-search-box {
124
+ max-width: 100%;
125
+ margin-bottom: 15px;
126
+ }
127
+ .ais-hits {
128
+ @include link-list;
129
+ }
130
+ .ais-pagination {
131
+ li {
132
+ text-decoration: none;
133
+ }
134
+ }
135
+ .ais-Highlight {
136
+ font-weight: bold;
137
+ font-style: normal;
138
+ }
139
+ .post-breadcrumbs {
140
+ display: block;
141
+ font-size: small;
142
+ }
143
+ .post-snippet img {
144
+ display: none;
130
145
  }
131
146
  }
132
- .ais-Highlight {
133
- font-weight: bold;
134
- font-style: normal;
135
- }
136
- .post-breadcrumbs {
137
- display: block;
138
- font-size: small;
139
- }
140
- .post-snippet img {
141
- display: none;
142
- }
143
-
144
147
  }
145
148
 
146
149
  .download {
@@ -2,5 +2,6 @@
2
2
  @import "mixins/_content-nav";
3
3
  @import "mixins/_aside-nav";
4
4
  @import "mixins/_link-list";
5
+ @import "mixins/_code-header";
5
6
 
6
7
  @import "mixins/_post-nav-explorer"
@@ -0,0 +1,42 @@
1
+ @mixin code-header {
2
+
3
+ .code-header {
4
+ display: flex;
5
+ justify-content: flex-end;
6
+ background: $black;
7
+ padding: 5px;
8
+ }
9
+
10
+ .copy-code-button {
11
+ @extend .btn, .btn-dark;
12
+ display: grid;
13
+ grid-auto-flow: column;
14
+ align-items: center;
15
+ grid-column-gap: 4px;
16
+ border: none;
17
+ cursor: pointer;
18
+ background-color: $black;
19
+ font-size: small;
20
+
21
+ &:before {
22
+ @extend .fas;
23
+ content: fa-content($fa-var-clipboard);
24
+ }
25
+ &:after {
26
+ content: "Copy";
27
+ display: block;
28
+ }
29
+
30
+ // This class will be toggled via JavaScript
31
+ &.copied {
32
+ &:before {
33
+ @extend .fas;
34
+ content: fa-content($fa-var-check);
35
+ color: $green;
36
+ }
37
+ &:after {
38
+ content: "Copied!";
39
+ }
40
+ }
41
+ }
42
+ }
@@ -4,6 +4,7 @@
4
4
  padding: 2.75rem;
5
5
  margin-top: -120px;
6
6
  min-height: 430px;
7
+ box-shadow: 0px -2px 3px 0px rgba(50, 50, 50, 0.25);
7
8
 
8
9
  h1, h2, h3, h4, h5, h6 {
9
10
  scroll-margin-top: $scroll-margin-top + 2.5;
@@ -69,4 +70,5 @@
69
70
  margin-bottom: $line-height-base * 1em;
70
71
  }
71
72
 
73
+ @include code-header;
72
74
  }
@@ -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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-centos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alain Reguera Delgado
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-10 00:00:00.000000000 Z
11
+ date: 2021-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -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