hexo-theme-gnix 8.0.0 → 10.0.0

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 (66) hide show
  1. package/README.md +4 -2
  2. package/include/hexo/feed.js +6 -5
  3. package/include/hexo/filter.js +25 -1
  4. package/include/hexo/generator/archive.js +116 -0
  5. package/include/hexo/generator/home.js +64 -0
  6. package/include/hexo/generator/index.js +82 -0
  7. package/include/hexo/generator/md_generator.js +87 -0
  8. package/include/hexo/generator/page.js +55 -0
  9. package/include/hexo/generator/tag.js +84 -0
  10. package/include/hexo/helper.js +38 -0
  11. package/include/hexo/i18n.js +183 -0
  12. package/include/util/article_font.js +132 -0
  13. package/include/util/i18n.js +280 -0
  14. package/include/util/theme.js +84 -0
  15. package/languages/en.yml +28 -0
  16. package/languages/zh-CN.yml +28 -0
  17. package/layout/archive.jsx +131 -127
  18. package/layout/common/article.jsx +316 -34
  19. package/layout/common/article_info.jsx +339 -0
  20. package/layout/common/article_media.jsx +11 -4
  21. package/layout/common/comment.jsx +15 -7
  22. package/layout/common/footer.jsx +6 -5
  23. package/layout/common/head.jsx +122 -33
  24. package/layout/common/navbar.jsx +195 -65
  25. package/layout/common/theme_selector.jsx +16 -14
  26. package/layout/layout.jsx +43 -5
  27. package/layout/misc/open_graph.jsx +162 -66
  28. package/layout/misc/paginator.jsx +2 -8
  29. package/layout/plugin/cookie_consent.jsx +252 -53
  30. package/layout/plugin/swup.jsx +1 -1
  31. package/layout/search/insight.jsx +1 -1
  32. package/layout/tag.jsx +3 -2
  33. package/layout/tags.jsx +81 -73
  34. package/package.json +5 -5
  35. package/scripts/index.js +1 -0
  36. package/source/css/archive.css +225 -180
  37. package/source/css/default.css +1223 -126
  38. package/source/css/responsive.css +426 -0
  39. package/source/css/shiki/shiki.css +12 -2081
  40. package/source/css/tags.css +183 -0
  41. package/source/css/twikoo.css +1053 -1049
  42. package/source/img/favicon.svg +1 -6
  43. package/source/img/og_image.webp +0 -0
  44. package/source/js/article-font-utils.js +99 -0
  45. package/source/js/busuanzi.js +91 -24
  46. package/source/js/components/chat.js +169 -50
  47. package/source/js/components/image-carousel.js +152 -108
  48. package/source/js/components/sidenote.js +210 -0
  49. package/source/js/components/text-image-section.js +78 -90
  50. package/source/js/components/theme-stacked.js +65 -33
  51. package/source/js/components/tree.js +30 -16
  52. package/source/js/decrypt.js +7 -2
  53. package/source/js/main.js +428 -5
  54. package/source/js/swup.js +39 -0
  55. package/source/js/theme-selector.js +26 -16
  56. package/include/hexo/generator.js +0 -53
  57. package/layout/misc/article_licensing.jsx +0 -99
  58. package/source/css/responsive/desktop.css +0 -36
  59. package/source/css/responsive/mobile.css +0 -38
  60. package/source/css/responsive/tablet.css +0 -43
  61. package/source/css/responsive/touch.css +0 -155
  62. package/source/img/logo.svg +0 -9
  63. package/source/js/archive-breadcrumb.js +0 -132
  64. package/source/js/host/cookieconsent/3.1.1/build/cookieconsent.min.css +0 -6
  65. package/source/js/host/cookieconsent/3.1.1/build/cookieconsent.min.js +0 -1
  66. package/source/js/swup.bundle.js +0 -1
@@ -1,251 +1,296 @@
1
- @keyframes blink {
2
- 0%,
3
- 100% {
4
- opacity: 1;
5
- }
6
- 50% {
7
- opacity: 0;
8
- }
1
+ .archive-page {
2
+ --archive-line: color-mix(in oklch, var(--surface1) 72%, var(--text));
3
+ --archive-muted: color-mix(in oklch, var(--subtext1) 78%, var(--base));
4
+ --archive-accent: var(--lavender);
5
+ display: grid;
6
+ gap: 1.5rem;
7
+ padding: 1.25em 1.25rem 0;
9
8
  }
10
9
 
11
- .article-meta {
12
- font-size: 0.8rem;
13
- color: var(--subtext1);
14
- font-family: var(--font-handwriting);
15
- white-space: nowrap;
10
+ .archive-hero {
11
+ display: grid;
12
+ grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem);
13
+ gap: 1.25rem;
14
+ align-items: start;
15
+ padding-bottom: 1.25rem;
16
+ border-bottom: 1px solid var(--archive-line);
16
17
  }
17
18
 
18
- a.archive-title {
19
- font-family: var(--font-sans-serif);
20
- font-weight: 400;
21
- color: var(--text);
19
+ .archive-eyebrow {
20
+ margin: 0 0 0.35rem;
21
+ color: var(--archive-muted);
22
+ font-family: var(--font-mono);
23
+ font-size: 0.75rem;
24
+ font-weight: 600;
25
+ letter-spacing: 0.08em;
26
+ text-transform: uppercase;
22
27
  }
23
28
 
24
- a.archive-title:hover {
25
- color: var(--accent);
29
+ .archive-hero h1 {
30
+ margin: 0;
31
+ color: var(--text);
32
+ font-family: var(--font-serif);
33
+ font-size: 2.75rem;
34
+ font-weight: 700;
35
+ line-height: 1;
36
+ letter-spacing: 0;
26
37
  }
27
38
 
28
- /* Breadcrumb navigation */
29
- .archive-breadcrumb {
30
- color: var(--blue);
31
- font-family: var(--font-mono);
32
- margin: 0 0 1rem 0;
33
- padding-left: 1em;
34
- display: flex;
35
- flex-wrap: wrap;
36
- align-items: center;
37
- gap: 0;
39
+ .archive-hero__summary {
40
+ max-width: 34rem;
41
+ margin: 1rem 0 0;
42
+ color: var(--subtext1);
43
+ font-family: var(--font-serif);
44
+ font-style: italic;
38
45
  }
39
46
 
40
- .archive-breadcrumb .prompt {
41
- color: var(--green);
42
- user-select: none;
43
- margin-right: 0.25em;
47
+ .archive-stats {
48
+ display: grid;
49
+ gap: 0.45rem;
50
+ margin: 0;
44
51
  }
45
52
 
46
- .archive-breadcrumb .cursor {
47
- display: inline-block;
48
- color: var(--mauve);
49
- font-weight: bold;
50
- margin-left: 2px;
51
- animation: blink 1s step-end infinite;
52
- user-select: none;
53
+ .archive-stats > div {
54
+ display: grid;
55
+ grid-template-columns: 4.5rem minmax(0, 1fr);
56
+ gap: 0.65rem;
57
+ align-items: baseline;
53
58
  }
54
59
 
55
- .archive-breadcrumb__cmd {
56
- color: var(--yellow);
57
- user-select: none;
58
- padding-right: 0.5em;
60
+ .archive-stats dt {
61
+ color: var(--archive-muted);
62
+ font-family: var(--font-mono);
63
+ font-size: 0.72rem;
64
+ text-transform: uppercase;
59
65
  }
60
66
 
61
- .archive-breadcrumb__picker {
62
- position: relative;
63
- display: inline-flex;
64
- align-items: center;
67
+ .archive-stats dd {
68
+ min-width: 0;
69
+ margin: 0;
70
+ color: var(--text);
71
+ font-weight: 700;
72
+ overflow-wrap: anywhere;
65
73
  }
66
74
 
67
- .archive-breadcrumb__trigger {
68
- display: inline-flex;
75
+ .archive-years {
76
+ display: flex;
77
+ flex-wrap: wrap;
78
+ gap: 0.5rem 0.75rem;
69
79
  align-items: center;
70
- border: none;
71
- background: transparent;
72
- color: var(--yellow);
73
80
  font-family: var(--font-mono);
74
- padding: 0.05em 0.15em;
75
- border-radius: 4px;
81
+ font-size: 0.85rem;
82
+ }
83
+
84
+ .archive-years a {
85
+ color: var(--archive-muted);
86
+ text-decoration: none;
87
+ text-underline-offset: 0.25em;
88
+ }
89
+
90
+ .archive-years a:hover,
91
+ .archive-years a:focus-visible,
92
+ .archive-years a.is-active {
93
+ color: var(--archive-accent);
76
94
  text-decoration: underline;
77
- text-decoration-color: hsl(from var(--yellow) h s l / 0.6);
78
- text-decoration-thickness: 1px;
79
- text-underline-offset: 0.22em;
80
- cursor: pointer;
81
- transition:
82
- transform 120ms ease,
83
- color 120ms ease,
84
- background 120ms ease,
85
- text-decoration-color 120ms ease;
86
95
  }
87
96
 
88
- .archive-breadcrumb__trigger:hover {
89
- color: var(--mauve);
90
- background: hsl(from var(--base) h s l / 0.35);
91
- text-decoration-color: hsl(from var(--mauve) h s l / 0.75);
97
+ .archive-stack {
98
+ display: grid;
99
+ gap: 1.35rem;
92
100
  }
93
101
 
94
- .archive-breadcrumb__trigger:focus-visible {
95
- outline: 2px solid hsl(from var(--mauve) h s l / 0.7);
96
- outline-offset: 2px;
97
- background: hsl(from var(--base) h s l / 0.35);
102
+ .archive-group {
103
+ --archive-accent: var(--lavender);
104
+ position: relative;
105
+ content-visibility: auto;
106
+ contain-intrinsic-size: auto 18rem;
107
+ padding: 1.35rem 0 0;
108
+ border-top: 1px dashed var(--archive-line);
98
109
  }
99
110
 
100
- .archive-breadcrumb__trigger[aria-expanded="true"] {
101
- transform: translateY(-1px);
102
- color: var(--mauve);
103
- text-decoration-color: hsl(from var(--mauve) h s l / 0.9);
111
+ .archive-group.spring {
112
+ --archive-accent: var(--peach);
104
113
  }
105
114
 
106
- .archive-breadcrumb__trigger[disabled] {
107
- opacity: 0.45;
108
- cursor: not-allowed;
109
- text-decoration-color: hsl(from var(--subtext1) h s l / 0.4);
115
+ .archive-group.summer {
116
+ --archive-accent: var(--green);
110
117
  }
111
118
 
112
- .archive-breadcrumb__menu {
113
- position: absolute;
114
- top: calc(100% + 6px);
115
- left: 0;
116
- min-width: 12rem;
117
- max-height: 15rem;
118
- overflow: auto;
119
- background: hsl(from var(--base) h s l / 0.9);
120
- border: 1px solid hsl(from var(--surface1) h s l / 0.9);
121
- border-radius: 10px;
122
- padding: 0.35rem;
123
- box-shadow: 0 18px 50px hsl(from var(--crust) h s l / 0.45);
124
- opacity: 0;
125
- transform: translateY(-6px);
126
- visibility: hidden;
127
- pointer-events: none;
128
- transition:
129
- opacity 160ms ease,
130
- transform 160ms ease,
131
- visibility 0s linear 160ms;
132
- z-index: 20;
119
+ .archive-group.autumn {
120
+ --archive-accent: var(--red);
133
121
  }
134
122
 
135
- .archive-breadcrumb__trigger[aria-expanded="true"] + .archive-breadcrumb__menu {
136
- opacity: 1;
137
- transform: translateY(0);
138
- visibility: visible;
139
- pointer-events: auto;
140
- transition:
141
- opacity 160ms ease,
142
- transform 160ms ease,
143
- visibility 0s;
123
+ .archive-group.winter {
124
+ --archive-accent: var(--blue);
144
125
  }
145
126
 
146
- .archive-breadcrumb__option {
147
- width: 100%;
127
+ .archive-group__header {
148
128
  display: flex;
129
+ gap: 1rem;
130
+ align-items: start;
149
131
  justify-content: space-between;
150
- align-items: center;
151
- gap: 0.5rem;
152
- padding: 0.35rem 0.5rem;
153
- border-radius: 8px;
154
- border: none;
155
- background: transparent;
132
+ margin-bottom: 1rem;
133
+ }
134
+
135
+ .archive-group__title {
136
+ margin: 0;
156
137
  color: var(--text);
157
- font-family: var(--font-mono);
158
- font-size: 0.9rem;
159
- cursor: pointer;
160
- transition:
161
- background 120ms ease,
162
- color 120ms ease;
163
- text-align: left;
138
+ font-family: var(--font-serif);
139
+ font-style: italic;
140
+ font-size: 1.7rem;
141
+ line-height: 1.08;
142
+ letter-spacing: 0;
143
+ padding-inline: 0.2rem;
164
144
  }
165
145
 
166
- .archive-breadcrumb__option:hover,
167
- .archive-breadcrumb__option:focus-visible {
168
- background: hsl(from var(--surface1) h s l / 0.55);
169
- color: var(--yellow);
170
- outline: none;
146
+ .archive-group__count {
147
+ flex: 0 0 auto;
148
+ border: 1px solid color-mix(in oklch, var(--archive-accent) 46%, var(--archive-line));
149
+ border-radius: 999px;
150
+ color: var(--text);
151
+ font-family: var(--font-mono);
152
+ font-size: 0.78rem;
153
+ padding: 0.2rem 0.6rem;
171
154
  }
172
155
 
173
- .archive-breadcrumb__option[aria-selected="true"] {
174
- background: hsl(from var(--surface1) h s l / 0.75);
175
- color: var(--mauve);
156
+ .timeline {
157
+ position: relative;
158
+ display: grid;
159
+ gap: 0.15rem;
160
+ padding-left: 1.25rem;
176
161
  }
177
162
 
178
- /* Card with year overlay */
179
- .card-content {
163
+ .archive-item {
180
164
  position: relative;
181
- overflow: hidden;
165
+ text-align: left;
182
166
  }
183
167
 
184
- span.year {
168
+ .archive-item::before {
185
169
  position: absolute;
186
- top: 1.5rem;
187
- right: 1.5rem;
188
- z-index: 0;
189
- pointer-events: none;
190
- font-weight: bolder;
191
- font-family: var(--font-handwriting);
192
- font-size: 4em;
193
- font-style: italic;
194
- color: hsl(from var(--accent, var(--lavender)) h s l / 0.3);
195
- line-height: 1;
196
- user-select: none;
170
+ top: 0.86rem;
171
+ left: -1.18rem;
172
+ width: 0.55rem;
173
+ height: 0.55rem;
174
+ border-radius: 999px;
175
+ background: transparent;
176
+ content: "";
177
+ transition:
178
+ background 140ms ease,
179
+ transform 140ms ease;
197
180
  }
198
181
 
199
- /* Season colors */
200
- .winter {
201
- --accent: var(--blue);
182
+ .archive-item:hover::before,
183
+ .archive-item:focus-within::before {
184
+ background: var(--archive-accent);
185
+ transform: scale(1.08);
202
186
  }
203
187
 
204
- .autumn {
205
- --accent: var(--red);
188
+ .archive-item > div {
189
+ display: grid;
190
+ grid-template-columns: 4.9rem minmax(0, 1fr);
191
+ gap: 0.85rem;
192
+ align-items: baseline;
193
+ padding: 0.55rem 0.35rem 0.55rem 0;
206
194
  }
207
195
 
208
- .summer {
209
- --accent: var(--green);
196
+ .archive-item + .archive-item {
197
+ border-top: 1px solid color-mix(in oklch, var(--archive-line) 52%, transparent);
210
198
  }
211
199
 
212
- .spring {
213
- --accent: var(--peach);
200
+ .article-meta {
201
+ margin: 0;
202
+ color: var(--archive-muted);
203
+ font-family: var(--font-mono);
204
+ font-size: 0.78rem;
205
+ line-height: 1.4;
206
+ white-space: nowrap;
214
207
  }
215
208
 
216
- /* Archive item */
217
- .archive-item {
218
- position: relative;
219
- display: flex;
220
- text-align: left;
221
- align-items: flex-start;
209
+ a.archive-title {
210
+ color: var(--text);
211
+ font-family: var(--font-serif);
212
+ font-size: 1.02rem;
213
+ font-weight: 500;
214
+ line-height: 1.45;
215
+ overflow-wrap: anywhere;
216
+ text-decoration: none;
217
+ text-decoration-color: transparent;
218
+ text-decoration-thickness: 1px;
219
+ text-underline-offset: 0.28em;
220
+ transition:
221
+ color 140ms ease,
222
+ text-decoration-color 140ms ease;
222
223
  }
223
224
 
224
- .archive-item > div {
225
- display: flex;
226
- align-items: baseline;
227
- gap: 0.75rem;
225
+ a.archive-title:hover,
226
+ a.archive-title:focus-visible {
227
+ color: var(--archive-accent);
228
+ text-decoration-color: currentColor;
228
229
  }
229
230
 
230
- .archive-item + .archive-item {
231
- border: none;
232
- margin-top: 0;
233
- padding-top: 1em;
231
+ a.archive-title:focus-visible {
232
+ outline: 2px solid color-mix(in oklch, var(--archive-accent) 70%, transparent);
233
+ outline-offset: 3px;
234
+ border-radius: 3px;
235
+ }
236
+
237
+ @media (max-width: 720px) {
238
+ .archive-page {
239
+ gap: 1.25rem;
240
+ }
241
+
242
+ .archive-hero {
243
+ grid-template-columns: 1fr;
244
+ }
245
+
246
+ .archive-hero h1 {
247
+ font-size: 2.35rem;
248
+ }
249
+
250
+ .archive-stats {
251
+ grid-template-columns: repeat(3, minmax(0, 1fr));
252
+ gap: 0.5rem;
253
+ }
254
+
255
+ .archive-stats > div {
256
+ display: block;
257
+ border-bottom: 0;
258
+ border-left: 1px solid color-mix(in oklch, var(--archive-line) 72%, transparent);
259
+ padding: 0 0 0 0.6rem;
260
+ }
234
261
  }
235
262
 
236
- /* Responsive */
237
263
  @media (max-width: 480px) {
238
- .archive-breadcrumb {
239
- padding-left: 0.5em;
264
+ .archive-page {
265
+ padding: 1rem 0.875rem 0;
266
+ }
267
+
268
+ .archive-hero h1 {
269
+ font-size: 2rem;
270
+ }
271
+
272
+ .archive-group__header {
273
+ display: grid;
240
274
  }
241
275
 
242
- .archive-breadcrumb__menu {
243
- min-width: 8rem;
244
- max-width: calc(100vw - 2rem);
276
+ .archive-group__count {
277
+ justify-self: start;
245
278
  }
246
279
 
247
- span.year {
248
- font-size: 2.5em;
249
- right: 0.5rem;
280
+ .archive-item > div {
281
+ grid-template-columns: 1fr;
282
+ gap: 0.1rem;
283
+ padding: 0.7rem 0.5rem 0.7rem 0;
284
+ }
285
+
286
+ .article-meta {
287
+ white-space: normal;
288
+ }
289
+ }
290
+
291
+ @media (prefers-reduced-motion: reduce) {
292
+ .archive-item::before,
293
+ a.archive-title {
294
+ transition: none;
250
295
  }
251
296
  }