jekyll-theme-chirpy 5.0.2 → 6.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +64 -74
  3. data/_data/locales/ar.yml +91 -0
  4. data/_data/locales/bg-BG.yml +81 -0
  5. data/_data/locales/cs-CZ.yml +89 -0
  6. data/_data/locales/de-DE.yml +80 -0
  7. data/_data/locales/el-GR.yml +91 -0
  8. data/_data/locales/en.yml +23 -23
  9. data/_data/locales/es-ES.yml +77 -0
  10. data/_data/locales/fi-FI.yml +90 -0
  11. data/_data/locales/fr-FR.yml +77 -0
  12. data/_data/locales/hu-HU.yml +79 -0
  13. data/_data/locales/id-ID.yml +5 -19
  14. data/_data/locales/it-IT.yml +90 -0
  15. data/_data/locales/ko-KR.yml +12 -19
  16. data/_data/locales/my-MM.yml +77 -0
  17. data/_data/locales/pt-BR.yml +77 -0
  18. data/_data/locales/ru-RU.yml +77 -0
  19. data/_data/locales/sl-SI.yml +91 -0
  20. data/_data/locales/sv-SE.yml +91 -0
  21. data/_data/locales/th.yml +91 -0
  22. data/_data/locales/tr-TR.yml +77 -0
  23. data/_data/locales/uk-UA.yml +77 -0
  24. data/_data/locales/vi-VN.yml +76 -0
  25. data/_data/locales/zh-CN.yml +13 -20
  26. data/_data/locales/zh-TW.yml +83 -0
  27. data/_data/origin/basic.yml +48 -0
  28. data/_data/origin/cors.yml +59 -0
  29. data/_includes/comments/disqus.html +27 -31
  30. data/_includes/comments/giscus.html +64 -0
  31. data/_includes/comments/utterances.html +2 -2
  32. data/_includes/datetime.html +20 -0
  33. data/_includes/embed/twitch.html +4 -0
  34. data/_includes/embed/youtube.html +6 -0
  35. data/_includes/footer.html +31 -32
  36. data/_includes/head.html +66 -46
  37. data/_includes/js-selector.html +83 -45
  38. data/_includes/jsdelivr-combine.html +26 -0
  39. data/_includes/lang.html +1 -1
  40. data/_includes/mermaid.html +30 -29
  41. data/_includes/metadata-hook.html +1 -0
  42. data/_includes/mode-toggle.html +66 -51
  43. data/_includes/notification.html +24 -0
  44. data/_includes/origin-type.html +13 -0
  45. data/_includes/post-nav.html +26 -22
  46. data/_includes/post-paginator.html +79 -76
  47. data/_includes/post-sharing.html +27 -16
  48. data/_includes/read-time.html +17 -10
  49. data/_includes/refactor-content.html +129 -73
  50. data/_includes/related-posts.html +48 -58
  51. data/_includes/search-loader.html +32 -31
  52. data/_includes/search-results.html +4 -5
  53. data/_includes/sidebar.html +79 -67
  54. data/_includes/toc.html +4 -7
  55. data/_includes/topbar.html +62 -56
  56. data/_includes/trending-tags.html +15 -19
  57. data/_includes/update-list.html +14 -15
  58. data/_layouts/archives.html +25 -29
  59. data/_layouts/categories.html +97 -58
  60. data/_layouts/category.html +8 -10
  61. data/_layouts/default.html +67 -31
  62. data/_layouts/home.html +67 -56
  63. data/_layouts/page.html +20 -58
  64. data/_layouts/post.html +85 -94
  65. data/_layouts/tag.html +8 -10
  66. data/_layouts/tags.html +6 -5
  67. data/_sass/addon/commons.scss +679 -878
  68. data/_sass/addon/module.scss +70 -23
  69. data/_sass/addon/syntax.scss +127 -110
  70. data/_sass/addon/variables.scss +16 -18
  71. data/_sass/colors/syntax-dark.scss +138 -0
  72. data/_sass/colors/syntax-light.scss +179 -0
  73. data/_sass/colors/{dark-typography.scss → typography-dark.scss} +58 -56
  74. data/_sass/colors/typography-light.scss +110 -0
  75. data/_sass/layout/archives.scss +86 -89
  76. data/_sass/layout/categories.scss +29 -13
  77. data/_sass/layout/category-tag.scss +9 -10
  78. data/_sass/layout/home.scss +132 -114
  79. data/_sass/layout/post.scss +213 -173
  80. data/_sass/layout/tags.scss +1 -1
  81. data/_sass/main.scss +13 -0
  82. data/assets/404.html +1 -20
  83. data/assets/css/jekyll-theme-chirpy.scss +6 -0
  84. data/assets/feed.xml +2 -2
  85. data/assets/js/data/search.json +8 -5
  86. data/assets/js/data/swcache.js +14 -29
  87. data/assets/js/dist/categories.min.js +2 -4
  88. data/assets/js/dist/commons.min.js +2 -4
  89. data/assets/js/dist/home.min.js +2 -4
  90. data/assets/js/dist/misc.min.js +4 -0
  91. data/assets/js/dist/page.min.js +2 -4
  92. data/assets/js/dist/post.min.js +2 -4
  93. data/assets/js/pwa/app.js +42 -4
  94. data/assets/js/pwa/sw.js +46 -44
  95. data/assets/js/pwa/unregister.js +12 -0
  96. metadata +64 -32
  97. data/_config.yml +0 -175
  98. data/_data/contact.yml +0 -30
  99. data/_data/share.yml +0 -27
  100. data/_includes/css-selector.html +0 -15
  101. data/_includes/no-zero-date.html +0 -13
  102. data/_includes/timeago.html +0 -26
  103. data/_plugins/posts-lastmod-hook.rb +0 -14
  104. data/_sass/colors/dark-syntax.scss +0 -87
  105. data/_sass/colors/light-syntax.scss +0 -79
  106. data/_sass/colors/light-typography.scss +0 -81
  107. data/_sass/jekyll-theme-chirpy.scss +0 -24
  108. data/_tabs/about.md +0 -8
  109. data/_tabs/archives.md +0 -7
  110. data/_tabs/categories.md +0 -6
  111. data/_tabs/tags.md +0 -6
  112. data/assets/css/style.scss +0 -12
  113. data/assets/js/dist/pvreport.min.js +0 -6
  114. data/index.html +0 -4
@@ -7,25 +7,27 @@
7
7
  %heading {
8
8
  color: var(--heading-color);
9
9
  font-weight: 400;
10
- font-family: 'Lato', 'Microsoft Yahei', sans-serif;
10
+ font-family: $font-family-heading;
11
11
  }
12
12
 
13
13
  %section {
14
- #core-wrapper & {
14
+ main & {
15
15
  margin-top: 2.5rem;
16
- margin-bottom: 2rem;
16
+ margin-bottom: 1.25rem;
17
+
18
+ &:focus {
19
+ outline: none; /* avoid outline in Safari */
20
+ }
17
21
  }
18
22
  }
19
23
 
20
24
  %anchor {
21
25
  .anchor {
22
- font-size: 1rem;
23
- margin-left: 0.5rem;
26
+ font-size: 80%;
24
27
  }
25
28
 
26
29
  @media (hover: hover) {
27
30
  .anchor {
28
- border-bottom: none !important;
29
31
  visibility: hidden;
30
32
  opacity: 0;
31
33
  transition: opacity 0.25s ease-in, visibility 0s ease-in 0.25s;
@@ -41,15 +43,6 @@
41
43
  }
42
44
  }
43
45
 
44
- %anchor-relative {
45
- @extend %anchor;
46
-
47
- .anchor {
48
- position: relative;
49
- bottom: 1px;
50
- }
51
- }
52
-
53
46
  %tag-hover {
54
47
  background: var(--tag-hover);
55
48
  transition: background 0.35s ease-in-out;
@@ -76,10 +69,13 @@
76
69
  }
77
70
 
78
71
  %clickable-transition {
79
- transition: color 0.35s ease-in-out;
72
+ transition: all 0.3s ease-in-out;
80
73
  }
81
74
 
82
75
  %no-cursor {
76
+ -webkit-user-select: none;
77
+ -moz-user-select: none;
78
+ -ms-user-select: none;
83
79
  user-select: none;
84
80
  }
85
81
 
@@ -95,28 +91,69 @@
95
91
  font-style: normal;
96
92
  }
97
93
 
98
- /* ---------- scss mixin --------- */
94
+ %rounded {
95
+ border-radius: $base-radius;
96
+ }
99
97
 
100
- @mixin no-text-decoration {
101
- text-decoration: none;
98
+ %img-caption {
99
+ + em {
100
+ display: block;
101
+ text-align: center;
102
+ font-style: normal;
103
+ font-size: 80%;
104
+ padding: 0;
105
+ color: #6d6c6c;
106
+ }
102
107
  }
103
108
 
104
109
  %sidebar-links {
105
- color: rgba(117, 117, 117, 0.9);
110
+ color: var(--sidebar-muted-color);
111
+ -webkit-user-select: none;
112
+ -moz-user-select: none;
113
+ -ms-user-select: none;
106
114
  user-select: none;
107
115
  }
108
116
 
117
+ %text-clip {
118
+ display: -webkit-box;
119
+ overflow: hidden;
120
+ text-overflow: ellipsis;
121
+ -webkit-line-clamp: 2;
122
+ -webkit-box-orient: vertical;
123
+ }
124
+
125
+ %text-highlight {
126
+ color: inherit;
127
+ font-weight: 600;
128
+ }
129
+
130
+ /* ---------- scss mixin --------- */
131
+
132
+ @mixin mt-mb($value) {
133
+ margin-top: $value;
134
+ margin-bottom: $value;
135
+ }
136
+
109
137
  @mixin ml-mr($value) {
110
138
  margin-left: $value;
111
139
  margin-right: $value;
112
140
  }
113
141
 
142
+ @mixin pt-pb($val) {
143
+ padding-top: $val;
144
+ padding-bottom: $val;
145
+ }
146
+
114
147
  @mixin pl-pr($val) {
115
148
  padding-left: $val;
116
149
  padding-right: $val;
117
150
  }
118
151
 
119
- @mixin input-placeholder {
152
+ @mixin placeholder {
153
+ color: var(--text-muted-color) !important;
154
+ }
155
+
156
+ @mixin placeholder-focus {
120
157
  opacity: 0.6;
121
158
  }
122
159
 
@@ -129,7 +166,17 @@
129
166
  @mixin align-center {
130
167
  position: relative;
131
168
  left: 50%;
132
- -webkit-transform: translateX(-50%);
133
- -ms-transform: translateX(-50%);
134
169
  transform: translateX(-50%);
135
170
  }
171
+
172
+ @mixin prompt($type, $fa-content, $fa-style: 'solid') {
173
+ &.prompt-#{$type} {
174
+ background-color: var(--prompt-#{$type}-bg);
175
+
176
+ &::before {
177
+ content: $fa-content;
178
+ color: var(--prompt-#{$type}-icon-color);
179
+ font: var(--fa-font-#{$fa-style});
180
+ }
181
+ }
182
+ }
@@ -2,39 +2,37 @@
2
2
  * The syntax highlight.
3
3
  */
4
4
 
5
- @import "colors/light-syntax";
6
- @import "colors/dark-syntax";
7
-
8
- html:not([mode]),
9
- html[mode=light] {
10
- @include light-syntax;
11
- }
12
-
13
- html[mode=dark] {
14
- @include dark-syntax;
15
- }
5
+ @import 'colors/syntax-light';
6
+ @import 'colors/syntax-dark';
7
+
8
+ html {
9
+ @media (prefers-color-scheme: light) {
10
+ &:not([data-mode]),
11
+ &[data-mode='light'] {
12
+ @include light-syntax;
13
+ }
16
14
 
17
- @media (prefers-color-scheme: dark) {
18
- html:not([mode]),
19
- html[mode=dark] {
20
- @include dark-syntax;
15
+ &[data-mode='dark'] {
16
+ @include dark-syntax;
17
+ }
21
18
  }
22
19
 
23
- html[mode=light] {
24
- @include light-syntax;
20
+ @media (prefers-color-scheme: dark) {
21
+ &:not([data-mode]),
22
+ &[data-mode='dark'] {
23
+ @include dark-syntax;
24
+ }
25
+
26
+ &[data-mode='light'] {
27
+ @include light-syntax;
28
+ }
25
29
  }
26
30
  }
27
31
 
28
- /* -- Codes Snippet -- */
29
-
30
- $code-radius: 6px;
32
+ /* -- code snippets -- */
31
33
 
32
34
  %code-snippet-bg {
33
- background: var(--highlight-bg-color);
34
- }
35
-
36
- %code-snippet-radius {
37
- border-radius: $code-radius;
35
+ background-color: var(--highlight-bg-color);
38
36
  }
39
37
 
40
38
  %code-snippet-padding {
@@ -43,16 +41,13 @@ $code-radius: 6px;
43
41
  }
44
42
 
45
43
  .highlighter-rouge {
46
- @extend %code-snippet-bg;
47
- @extend %code-snippet-radius;
48
-
49
44
  color: var(--highlighter-rouge-color);
50
45
  margin-top: 0.5rem;
51
46
  margin-bottom: 1.2em; /* Override BS Inline-code style */
52
47
  }
53
48
 
54
49
  .highlight {
55
- @extend %code-snippet-radius;
50
+ @extend %rounded;
56
51
  @extend %code-snippet-bg;
57
52
 
58
53
  @at-root figure#{&} {
@@ -60,8 +55,7 @@ $code-radius: 6px;
60
55
  }
61
56
 
62
57
  overflow: auto;
63
- padding-top: 0.5rem;
64
- padding-bottom: 1rem;
58
+ padding-bottom: 0.75rem;
65
59
 
66
60
  pre {
67
61
  margin-bottom: 0;
@@ -71,47 +65,58 @@ $code-radius: 6px;
71
65
  }
72
66
 
73
67
  table {
74
- td pre {
75
- overflow: visible; /* Fixed iOS safari overflow-x */
76
- word-break: normal; /* Fixed iOS safari linenos code break */
68
+ td {
69
+ &:first-child {
70
+ display: inline-block;
71
+ margin-left: 1rem;
72
+ margin-right: 0.75rem;
73
+ }
74
+
75
+ &:last-child {
76
+ padding-right: 2rem !important;
77
+ }
78
+
79
+ pre {
80
+ overflow: visible; /* Fixed iOS safari overflow-x */
81
+ word-break: normal; /* Fixed iOS safari linenos code break */
82
+ }
77
83
  }
78
84
  }
79
85
 
80
86
  .lineno {
81
- padding-right: 0.5rem;
82
- min-width: 2.2rem;
83
87
  text-align: right;
84
88
  color: var(--highlight-lineno-color);
85
89
  -webkit-user-select: none;
86
- -khtml-user-select: none;
87
90
  -moz-user-select: none;
88
- -ms-user-select: none;
89
91
  -o-user-select: none;
92
+ -ms-user-select: none;
90
93
  user-select: none;
91
94
  }
92
-
93
- /* set the dollar sign to non-selectable */
94
- .gp {
95
- user-select: none;
96
- }
97
-
98
- } //.highlight
95
+ } /* .highlight */
99
96
 
100
97
  code {
101
98
  -webkit-hyphens: none;
102
99
  -ms-hyphens: none;
103
- -moz-hyphens: none;
104
100
  hyphens: none;
101
+ color: var(--code-color);
105
102
 
106
103
  &.highlighter-rouge {
107
104
  font-size: $code-font-size;
108
105
  padding: 3px 5px;
106
+ word-break: break-word;
109
107
  border-radius: 4px;
110
108
  background-color: var(--inline-code-bg);
111
109
  }
112
110
 
111
+ &.filepath {
112
+ background-color: inherit;
113
+ color: var(--filepath-text-color);
114
+ font-weight: 600;
115
+ padding: 0;
116
+ }
117
+
113
118
  a > &.highlighter-rouge {
114
- padding-bottom: 0; // show link's underlinke
119
+ padding-bottom: 0; /* show link's underlinke */
115
120
  color: inherit;
116
121
  }
117
122
 
@@ -119,41 +124,56 @@ code {
119
124
  border-bottom: none;
120
125
  }
121
126
 
122
- blockquote &.highlighter-rouge {
127
+ blockquote & {
123
128
  color: inherit;
124
129
  }
125
-
126
- .highlight > & {
127
- color: transparent;
128
- }
129
130
  }
130
131
 
131
132
  td.rouge-code {
132
133
  @extend %code-snippet-padding;
133
134
 
134
- // Prevent some browser extends from
135
- // changing the URL string of code block.
135
+ /*
136
+ Prevent some browser extends from
137
+ changing the URL string of code block.
138
+ */
136
139
  a {
137
140
  color: inherit !important;
138
141
  border-bottom: none !important;
139
142
  pointer-events: none;
140
143
  }
144
+ }
145
+
146
+ div[class^='language-'] {
147
+ @extend %rounded;
148
+ @extend %code-snippet-bg;
149
+
150
+ box-shadow: var(--language-border-color) 0 0 0 1px;
151
+
152
+ .content > & {
153
+ @include ml-mr(-1rem);
154
+
155
+ border-radius: 0;
156
+ }
141
157
 
158
+ .highlight {
159
+ border-top-left-radius: 0;
160
+ border-top-right-radius: 0;
161
+ }
142
162
  }
143
163
 
144
164
  /* Hide line numbers for default, console, and terminal code snippets */
145
165
  div {
146
- &[class^='highlighter-rouge'],
147
- &.language-plaintext.highlighter-rouge,
148
- &.language-console.highlighter-rouge,
149
- &.language-terminal.highlighter-rouge,
150
- &.nolineno {
151
- pre.lineno {
152
- display: none;
153
- }
154
-
155
- td.rouge-code {
156
- padding-left: 1.5rem;
166
+ &.nolineno,
167
+ &.language-plaintext,
168
+ &.language-console,
169
+ &.language-terminal {
170
+ td:first-child {
171
+ padding: 0 !important;
172
+ margin-right: 0;
173
+
174
+ .lineno {
175
+ display: none;
176
+ }
157
177
  }
158
178
  }
159
179
  }
@@ -161,37 +181,21 @@ div {
161
181
  .code-header {
162
182
  @extend %no-cursor;
163
183
 
164
- $code-header-height: 2.25rem;
165
-
166
- border-top-left-radius: $code-radius;
167
- border-top-right-radius: $code-radius;
168
184
  display: flex;
169
185
  justify-content: space-between;
170
186
  align-items: center;
171
187
  height: $code-header-height;
188
+ margin-left: 0.75rem;
189
+ margin-right: 0.5rem;
172
190
 
173
- &::before {
174
- $dot-size: 0.75rem;
175
- $dot-margin: 0.5rem;
176
-
177
- content: "";
178
- display: inline-block;
179
- margin-left: 1rem;
180
- width: $dot-size;
181
- height: $dot-size;
182
- border-radius: 50%;
183
- background-color: var(--code-header-muted-color);
184
- box-shadow:
185
- ($dot-size + $dot-margin) 0 0 var(--code-header-muted-color),
186
- ($dot-size + $dot-margin) * 2 0 0 var(--code-header-muted-color);
187
- }
188
-
189
- // the label block
191
+ /* the label block */
190
192
  span {
191
- // label icon
193
+ line-height: $code-header-height;
194
+
195
+ /* label icon */
192
196
  i {
193
197
  font-size: 1rem;
194
- margin-right: 0.4rem;
198
+ width: $code-icon-width;
195
199
  color: var(--code-header-icon-color);
196
200
 
197
201
  &.small {
@@ -201,24 +205,24 @@ div {
201
205
 
202
206
  @at-root [file] #{&} > i {
203
207
  position: relative;
204
- top: 1px; // center the file icon
208
+ top: 1px; /* center the file icon */
205
209
  }
206
210
 
207
- // label text
211
+ /* label text */
208
212
  &::after {
209
- content: attr(label-text);
213
+ content: attr(data-label-text);
210
214
  font-size: 0.85rem;
211
215
  font-weight: 600;
212
216
  color: var(--code-header-text-color);
213
217
  }
214
218
  }
215
219
 
216
- // clipboard
220
+ /* clipboard */
217
221
  button {
218
222
  @extend %cursor-pointer;
223
+ @extend %rounded;
219
224
 
220
225
  border: 1px solid transparent;
221
- border-radius: $code-radius;
222
226
  height: $code-header-height;
223
227
  width: $code-header-height;
224
228
  padding: 0;
@@ -238,6 +242,10 @@ div {
238
242
  }
239
243
  }
240
244
 
245
+ &:focus {
246
+ outline: none;
247
+ }
248
+
241
249
  &:not([timeout]):hover {
242
250
  background-color: rgba(128, 128, 128, 0.37);
243
251
 
@@ -245,30 +253,39 @@ div {
245
253
  color: white;
246
254
  }
247
255
  }
248
-
249
- &:focus {
250
- outline: none;
251
- }
252
-
253
256
  }
254
-
255
257
  }
256
258
 
257
- @media all and (max-width: 576px) {
258
- .post-content {
259
- > div[class^='language-'] {
260
- @include ml-mr(-1.25rem);
259
+ @media all and (min-width: 576px) {
260
+ div[class^='language-'] {
261
+ .content > & {
262
+ @include ml-mr(0);
261
263
 
262
- border-radius: 0;
264
+ border-radius: $base-radius;
265
+ }
263
266
 
264
- .highlight {
265
- padding-left: 0.25rem;
267
+ .code-header {
268
+ @include ml-mr(0);
269
+
270
+ $dot-margin: calc($code-header-height / 2);
271
+
272
+ &::before {
273
+ content: '';
274
+ display: inline-block;
275
+ margin-left: $dot-margin;
276
+ width: $code-dot-size;
277
+ height: $code-dot-size;
278
+ border-radius: 50%;
279
+ background-color: var(--code-header-muted-color);
280
+ box-shadow: ($code-dot-size + $code-dot-gap) 0 0
281
+ var(--code-header-muted-color),
282
+ ($code-dot-size + $code-dot-gap) * 2 0 0
283
+ var(--code-header-muted-color);
266
284
  }
267
285
 
268
- .code-header {
269
- border-radius: 0;
270
- padding-left: 0.4rem;
271
- padding-right: 0.5rem;
286
+ span {
287
+ // center the text of label
288
+ margin-left: calc(($dot-margin + $code-dot-size) / 2 * -1);
272
289
  }
273
290
  }
274
291
  }
@@ -4,31 +4,29 @@
4
4
 
5
5
  /* sidebar */
6
6
 
7
- $sidebar-width: 260px !default; // the basic width
8
- $sidebar-width-small: 210px !default; // screen width: >= 850px, <= 1199px (iPad landscape)
9
- $sidebar-width-large: 350px !default; // screen width: >= 1650px
10
-
11
- /* tabs of sidebar */
12
-
13
- $tab-count: 5 !default; // backward compatible (version <= 4.0.2)
14
- $tab-height: 3rem !default;
15
- $tab-cursor-height: 1.6rem !default;
16
-
17
- $cursor-width: 2px !default; // the cursor width of the selected tab
7
+ $sidebar-width: 260px !default; /* the basic width */
8
+ $sidebar-width-large: 300px !default; /* screen width: >= 1650px */
18
9
 
19
10
  /* other framework sizes */
20
11
 
21
12
  $topbar-height: 3rem !default;
22
-
13
+ $search-max-width: 200px !default;
23
14
  $footer-height: 5rem !default;
24
- $footer-height-mobile: 6rem !default; // screen width: <= 576px
25
-
26
- $main-content-max-width: 1150px !default;
27
-
28
- $panel-max-width: 300px !default;
29
-
15
+ $footer-height-large: 6rem !default; /* screen width: < 850px */
16
+ $main-content-max-width: 1250px !default;
30
17
  $bottom-min-height: 35rem !default;
18
+ $base-radius: 0.5rem !default;
19
+ $back2top-size: 2.75rem !default;
31
20
 
32
21
  /* syntax highlight */
33
22
 
34
23
  $code-font-size: 0.85rem !default;
24
+ $code-header-height: 2.25rem !default;
25
+ $code-dot-size: 0.75rem !default;
26
+ $code-dot-gap: 0.5rem !default;
27
+ $code-icon-width: 1.75rem !default;
28
+
29
+ /* fonts */
30
+
31
+ $font-family-base: 'Source Sans Pro', 'Microsoft Yahei', sans-serif !default;
32
+ $font-family-heading: Lato, 'Microsoft Yahei', sans-serif !default;