hexo-theme-gnix 1.1.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 (143) hide show
  1. package/README.md +106 -0
  2. package/include/hexo/filter/locals.js +109 -0
  3. package/include/hexo/generator/categories.js +12 -0
  4. package/include/hexo/generator/category.js +52 -0
  5. package/include/hexo/generator/insight.js +50 -0
  6. package/include/hexo/generator/manifest.js +23 -0
  7. package/include/hexo/generator/tags.js +12 -0
  8. package/include/hexo/helper/cdn.js +21 -0
  9. package/include/hexo/helper/page.js +27 -0
  10. package/include/hexo/view.js +40 -0
  11. package/include/register.js +11 -0
  12. package/include/util/common.js +33 -0
  13. package/languages/en.yml +47 -0
  14. package/languages/fr.yml +46 -0
  15. package/languages/ja.yml +46 -0
  16. package/languages/zh-CN.yml +47 -0
  17. package/languages/zh-TW.yml +47 -0
  18. package/layout/archive.jsx +118 -0
  19. package/layout/categories.jsx +137 -0
  20. package/layout/category.jsx +38 -0
  21. package/layout/comment/disqus.jsx +79 -0
  22. package/layout/comment/disqusjs.jsx +127 -0
  23. package/layout/comment/giscus.jsx +193 -0
  24. package/layout/comment/gitalk.jsx +141 -0
  25. package/layout/comment/twikoo.jsx +63 -0
  26. package/layout/comment/utterances.jsx +86 -0
  27. package/layout/comment/valine.jsx +143 -0
  28. package/layout/comment/waline.jsx +156 -0
  29. package/layout/common/article.jsx +131 -0
  30. package/layout/common/article_cover.jsx +33 -0
  31. package/layout/common/article_media.jsx +34 -0
  32. package/layout/common/comment.jsx +38 -0
  33. package/layout/common/footer.jsx +228 -0
  34. package/layout/common/head.jsx +242 -0
  35. package/layout/common/navbar.jsx +219 -0
  36. package/layout/common/plugins.jsx +39 -0
  37. package/layout/common/scripts.jsx +49 -0
  38. package/layout/common/search.jsx +22 -0
  39. package/layout/common/theme_selector.jsx +79 -0
  40. package/layout/common/toc.jsx +53 -0
  41. package/layout/index.jsx +29 -0
  42. package/layout/layout.jsx +34 -0
  43. package/layout/misc/article_licensing.jsx +114 -0
  44. package/layout/misc/meta.jsx +61 -0
  45. package/layout/misc/open_graph.jsx +164 -0
  46. package/layout/misc/paginator.jsx +90 -0
  47. package/layout/misc/structured_data.jsx +110 -0
  48. package/layout/misc/web_app.jsx +106 -0
  49. package/layout/page.jsx +12 -0
  50. package/layout/plugin/bing_webmaster.jsx +47 -0
  51. package/layout/plugin/busuanzi.jsx +40 -0
  52. package/layout/plugin/clarity.jsx +22 -0
  53. package/layout/plugin/cookie_consent.jsx +136 -0
  54. package/layout/plugin/google_analytics.jsx +66 -0
  55. package/layout/plugin/google_tag_mamager.jsx +41 -0
  56. package/layout/plugin/netlify.jsx +39 -0
  57. package/layout/plugin/pjax.jsx +20 -0
  58. package/layout/plugin/statcounter.jsx +69 -0
  59. package/layout/plugin/twitter_conversion_tracking.jsx +51 -0
  60. package/layout/post.jsx +16 -0
  61. package/layout/search/insight.jsx +53 -0
  62. package/layout/tag.jsx +29 -0
  63. package/layout/tags.jsx +55 -0
  64. package/package.json +42 -0
  65. package/scripts/index.js +1 -0
  66. package/source/css/callout_blocks.css +204 -0
  67. package/source/css/default.css +1590 -0
  68. package/source/css/font/woff2/Futura-Book.woff2 +0 -0
  69. package/source/css/font/woff2/Paris2024-Variable.woff2 +0 -0
  70. package/source/css/font/woff2/doto.woff2 +0 -0
  71. package/source/css/optional/chinese.css +17 -0
  72. package/source/css/responsive/desktop.css +164 -0
  73. package/source/css/responsive/mobile.css +46 -0
  74. package/source/css/responsive/tablet.css +46 -0
  75. package/source/css/responsive/touch.css +254 -0
  76. package/source/css/shiki/shiki.min.css +1 -0
  77. package/source/css/twikoo.css +2143 -0
  78. package/source/img/avatar.webp +0 -0
  79. package/source/img/background.webp +0 -0
  80. package/source/img/favicon.svg +6 -0
  81. package/source/img/logo.svg +9 -0
  82. package/source/img/og_image.png +0 -0
  83. package/source/js/busuanzi.js +46 -0
  84. package/source/js/host/cookieconsent/3.1.1/build/cookieconsent.min.css +6 -0
  85. package/source/js/host/cookieconsent/3.1.1/build/cookieconsent.min.js +1 -0
  86. package/source/js/host/iconify-icon/3.0.2/iconify-icon.min.js +12 -0
  87. package/source/js/host/medium-zoom/dist/medium-zoom.min.js +2 -0
  88. package/source/js/host/mermaid/mermaid.min.js +2811 -0
  89. package/source/js/host/pjax/0.2.8/pjax.min.js +1 -0
  90. package/source/js/host/twikoo/1.6.41/dist/twikoo.all.min.js +2 -0
  91. package/source/js/insight.js +330 -0
  92. package/source/js/instant-page.min.js +1 -0
  93. package/source/js/live2d_Asoul/Model/Ava/Ava.4096/texture_00.webp +0 -0
  94. package/source/js/live2d_Asoul/Model/Ava/Ava.moc3 +0 -0
  95. package/source/js/live2d_Asoul/Model/Ava/Ava.model3.json +323 -0
  96. package/source/js/live2d_Asoul/Model/Ava/Ava.physics3.json +1225 -0
  97. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_idle.motion3.json +1 -0
  98. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_shake01.motion3.json +1 -0
  99. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_shake02.motion3.json +1 -0
  100. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap01.motion3.json +1 -0
  101. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap02.motion3.json +1 -0
  102. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap03.motion3.json +1 -0
  103. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap04.motion3.json +1 -0
  104. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap05.motion3.json +1 -0
  105. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap06.motion3.json +1 -0
  106. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap07.motion3.json +1 -0
  107. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap08.motion3.json +1 -0
  108. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap09.motion3.json +1 -0
  109. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap10.motion3.json +1 -0
  110. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap11.motion3.json +1 -0
  111. package/source/js/live2d_Asoul/Model/Ava/raw.ex.json +16 -0
  112. package/source/js/live2d_Asoul/Model/Ava/raw.model3.json +321 -0
  113. package/source/js/live2d_Asoul/Model/Diana/Diana.4096/texture_00.webp +0 -0
  114. package/source/js/live2d_Asoul/Model/Diana/Diana.moc3 +0 -0
  115. package/source/js/live2d_Asoul/Model/Diana/Diana.model3.json +212 -0
  116. package/source/js/live2d_Asoul/Model/Diana/Diana.physics3.json +764 -0
  117. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_idle.motion3.json +1 -0
  118. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap01.motion3.json +1 -0
  119. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap02.motion3.json +1 -0
  120. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap03.motion3.json +1 -0
  121. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap04.motion3.json +1 -0
  122. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap05.motion3.json +1 -0
  123. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap06.motion3.json +1 -0
  124. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap07.motion3.json +1 -0
  125. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap08.motion3.json +1 -0
  126. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap09.motion3.json +1 -0
  127. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap10.motion3.json +1 -0
  128. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap11.motion3.json +1 -0
  129. package/source/js/live2d_Asoul/Model/Diana/raw.ex.json +16 -0
  130. package/source/js/live2d_Asoul/Model/Diana/raw.model3.json +210 -0
  131. package/source/js/live2d_Asoul/TweenLite.js +12 -0
  132. package/source/js/live2d_Asoul/cubism4.min.js +2 -0
  133. package/source/js/live2d_Asoul/live2dcubismcore.min.js +9 -0
  134. package/source/js/live2d_Asoul/load.js +231 -0
  135. package/source/js/live2d_Asoul/pio.css +161 -0
  136. package/source/js/live2d_Asoul/pio.js +296 -0
  137. package/source/js/live2d_Asoul/pio_sdk4.js +149 -0
  138. package/source/js/live2d_Asoul/pixi.min.js +9 -0
  139. package/source/js/main.js +218 -0
  140. package/source/js/pjax.js +29 -0
  141. package/source/js/shiki/shiki.js +191 -0
  142. package/source/js/theme-selector.js +206 -0
  143. package/util/cache.js +47 -0
@@ -0,0 +1,242 @@
1
+ const { Component } = require("../../include/util/common");
2
+ const MetaTags = require("../../layout/misc/meta");
3
+ const WebApp = require("../../layout/misc/web_app");
4
+ const OpenGraph = require("../../layout/misc/open_graph");
5
+ const StructuredData = require("../../layout/misc/structured_data");
6
+ const Plugins = require("./plugins");
7
+
8
+ function getPageTitle(page, siteTitle, helper) {
9
+ let title = page.title;
10
+
11
+ if (helper.is_archive()) {
12
+ title = helper._p("common.archive", Infinity);
13
+ if (helper.is_month()) {
14
+ title += `: ${page.year}/${page.month}`;
15
+ } else if (helper.is_year()) {
16
+ title += `: ${page.year}`;
17
+ }
18
+ } else if (helper.is_category()) {
19
+ title = `${helper._p("common.category", 1)}: ${page.category}`;
20
+ } else if (helper.is_tag()) {
21
+ title = `${helper._p("common.tag", 1)}: ${page.tag}`;
22
+ } else if (helper.is_categories()) {
23
+ title = helper._p("common.category", Infinity);
24
+ } else if (helper.is_tags()) {
25
+ title = helper._p("common.tag", Infinity);
26
+ }
27
+
28
+ return [title, siteTitle]
29
+ .filter((str) => typeof str !== "undefined" && str.trim() !== "")
30
+ .join(" - ");
31
+ }
32
+
33
+ module.exports = class extends Component {
34
+ render() {
35
+ const { site, config, helper, page } = this.props;
36
+ const { url_for, is_post } = helper;
37
+ const { url, head = {}, article } = config;
38
+ const {
39
+ meta = [],
40
+ manifest = {},
41
+ open_graph = {},
42
+ structured_data = {},
43
+ canonical_url = page.permalink,
44
+ rss,
45
+ favicon,
46
+ } = head;
47
+
48
+ const noIndex =
49
+ helper.is_archive() || helper.is_category() || helper.is_tag();
50
+
51
+ const language = page.lang || page.language || config.language;
52
+
53
+ let images;
54
+ if (typeof page.og_image === "string") {
55
+ images = [page.og_image];
56
+ } else if (typeof page.cover === "string") {
57
+ images = [url_for(page.cover)];
58
+ } else if (typeof page.thumbnail === "string") {
59
+ images = [url_for(page.thumbnail)];
60
+ } else if (article && typeof article.og_image === "string") {
61
+ images = [article.og_image];
62
+ } else if (page.content?.includes("<img")) {
63
+ let img;
64
+ images = [];
65
+ const imgPattern = /<img [^>]*src=['"]([^'"]+)([^>]*>)/gi;
66
+ while ((img = imgPattern.exec(page.content)) !== null) {
67
+ images.push(img[1]);
68
+ }
69
+ } else {
70
+ images = [url_for("/img/og_image.png")];
71
+ }
72
+
73
+ let adsenseClientId = null;
74
+ if (Array.isArray(config.widgets)) {
75
+ const widget = config.widgets.find((widget) => widget.type === "adsense");
76
+ if (widget) {
77
+ adsenseClientId = widget.client_id;
78
+ }
79
+ }
80
+
81
+ let openGraphImages = images;
82
+ if (
83
+ typeof open_graph === "object" &&
84
+ open_graph !== null &&
85
+ ((Array.isArray(open_graph.image) && open_graph.image.length > 0) ||
86
+ typeof open_graph.image === "string")
87
+ ) {
88
+ openGraphImages = open_graph.image;
89
+ } else if (
90
+ (Array.isArray(page.photos) && page.photos.length > 0) ||
91
+ typeof page.photos === "string"
92
+ ) {
93
+ openGraphImages = page.photos;
94
+ }
95
+
96
+ let structuredImages = images;
97
+ if (
98
+ typeof structured_data === "object" &&
99
+ structured_data !== null &&
100
+ ((Array.isArray(structured_data.image) &&
101
+ structured_data.image.length > 0) ||
102
+ typeof structured_data.image === "string")
103
+ ) {
104
+ structuredImages = structured_data.image;
105
+ } else if (
106
+ (Array.isArray(page.photos) && page.photos.length > 0) ||
107
+ typeof page.photos === "string"
108
+ ) {
109
+ structuredImages = page.photos;
110
+ }
111
+
112
+ return (
113
+ <head>
114
+ <meta charset="utf-8" />
115
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
116
+ {noIndex ? <meta name="robots" content="noindex" /> : null}
117
+ {meta?.length ? <MetaTags meta={meta} /> : null}
118
+ <title>{getPageTitle(page, config.title, helper)}</title>
119
+ <WebApp.Cacheable
120
+ helper={helper}
121
+ favicon={favicon}
122
+ icons={manifest.icons}
123
+ themeColor={manifest.theme_color}
124
+ name={manifest.name || config.title}
125
+ />
126
+ {typeof open_graph === "object" && open_graph !== null ? (
127
+ <OpenGraph
128
+ type={open_graph.type || (is_post(page) ? "article" : "website")}
129
+ title={open_graph.title || page.title || config.title}
130
+ date={page.date}
131
+ updated={page.updated}
132
+ author={open_graph.author || config.author}
133
+ description={
134
+ open_graph.description ||
135
+ page.description ||
136
+ page.excerpt ||
137
+ page.content ||
138
+ config.description
139
+ }
140
+ keywords={
141
+ (page.tags?.length ? page.tags : undefined) || config.keywords
142
+ }
143
+ url={open_graph.url || page.permalink || url}
144
+ images={openGraphImages}
145
+ siteName={open_graph.site_name || config.title}
146
+ language={language}
147
+ twitterId={open_graph.twitter_id}
148
+ twitterCard={open_graph.twitter_card}
149
+ twitterSite={open_graph.twitter_site}
150
+ googlePlus={open_graph.google_plus}
151
+ facebookAdmins={open_graph.fb_admins}
152
+ facebookAppId={open_graph.fb_app_id}
153
+ />
154
+ ) : null}
155
+ {typeof structured_data === "object" && structured_data !== null ? (
156
+ <StructuredData
157
+ title={structured_data.title || page.title || config.title}
158
+ description={
159
+ structured_data.description ||
160
+ page.description ||
161
+ page.excerpt ||
162
+ page.content ||
163
+ config.description
164
+ }
165
+ url={structured_data.url || page.permalink || url}
166
+ author={structured_data.author || config.author}
167
+ publisher={structured_data.publisher || config.title}
168
+ publisherLogo={structured_data.publisher_logo || config.logo}
169
+ date={page.date}
170
+ updated={page.updated}
171
+ images={structuredImages}
172
+ />
173
+ ) : null}
174
+ {canonical_url ? <link rel="canonical" href={canonical_url} /> : null}
175
+ {rss ? (
176
+ <link
177
+ rel="alternate"
178
+ href={url_for(rss)}
179
+ title={config.title}
180
+ type="application/atom+xml"
181
+ />
182
+ ) : null}
183
+ {favicon ? <link rel="icon" href={url_for(favicon)} /> : null}
184
+ <link rel="stylesheet" href={url_for("/css/default.css")} />
185
+ <link
186
+ rel="stylesheet"
187
+ href={url_for("/css/responsive/mobile.css")}
188
+ media="screen and (max-width:768px)"
189
+ />
190
+ <link
191
+ rel="stylesheet"
192
+ href={url_for("/css/responsive/tablet.css")}
193
+ media="screen and (min-width:769px)"
194
+ />
195
+ <link
196
+ rel="stylesheet"
197
+ href={url_for("/css/responsive/touch.css")}
198
+ media="screen and (max-width:1023px)"
199
+ />
200
+ <link
201
+ rel="stylesheet"
202
+ href={url_for("/css/responsive/desktop.css")}
203
+ media="screen and (min-width:1024px)"
204
+ />
205
+ <script type="text/javascript" src="/js/theme-selector.js"></script>
206
+ <link
207
+ rel="preload"
208
+ as="style"
209
+ href={url_for("/css/callout_blocks.css")}
210
+ onload="this.onload=null;this.rel='stylesheet'"
211
+ />
212
+ <link rel="stylesheet" href="/css/shiki/shiki.min.css" />
213
+ {/* Iconify Icons */}
214
+ <script
215
+ async
216
+ src="/js/host/iconify-icon/3.0.2/iconify-icon.min.js"
217
+ ></script>
218
+ {/* Maple Mono CN */}
219
+ <link
220
+ rel="preload"
221
+ as="style"
222
+ href="https://fontsapi.zeoseven.com/442/main/result.css"
223
+ onload="this.onload=null;this.rel='stylesheet'"
224
+ />
225
+ <Plugins
226
+ site={site}
227
+ config={config}
228
+ helper={helper}
229
+ page={page}
230
+ head={true}
231
+ />
232
+ {adsenseClientId ? (
233
+ <script
234
+ data-ad-client={adsenseClientId}
235
+ src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"
236
+ async
237
+ ></script>
238
+ ) : null}
239
+ </head>
240
+ );
241
+ }
242
+ };
@@ -0,0 +1,219 @@
1
+ const { Component, Fragment } = require("../../include/util/common");
2
+ const { cacheComponent } = require("../../util/cache");
3
+
4
+ function isSameLink(a, b) {
5
+ function santize(url) {
6
+ let paths = url
7
+ .replace(/(^\w+:|^)\/\//, "")
8
+ .split("#")[0]
9
+ .split("/")
10
+ .filter((p) => p.trim() !== "");
11
+ if (paths.length > 0 && paths[paths.length - 1].trim() === "index.html") {
12
+ paths = paths.slice(0, paths.length - 1);
13
+ }
14
+ return paths.join("/");
15
+ }
16
+ return santize(a) === santize(b);
17
+ }
18
+
19
+ const renderLinkIcon = (link) => {
20
+ if (!link.icon) return null;
21
+ // start with '<' means svg icon
22
+ if (link.icon === "travellings") {
23
+ return (
24
+ <svg
25
+ xmlns="http://www.w3.org/2000/svg"
26
+ viewBox="0 0 448 512"
27
+ role="img"
28
+ aria-label="Travellings Icon"
29
+ >
30
+ <path
31
+ fill="var(--text)"
32
+ d="M96 0C43 0 0 43 0 96v256c0 48 35.2 87.7 81.1 94.9l-46 46c-7 7-2 19.1 7.9 19.1h39.7c8.5 0 16.6-3.4 22.6-9.4L160 448h128l54.6 54.6c6 6 14.1 9.4 22.6 9.4h39.7c10 0 15-12.1 7.9-19.1l-46-46c46-7.1 81.1-46.9 81.1-94.9V96c0-53-43-96-96-96zM64 128c0-17.7 14.3-32 32-32h80c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32zm208-32h80c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32h-80c-17.7 0-32-14.3-32-32v-96c0-17.7 14.3-32 32-32M64 352a32 32 0 1 1 64 0a32 32 0 1 1-64 0m288-32a32 32 0 1 1 0 64a32 32 0 1 1 0-64"
33
+ ></path>
34
+ </svg>
35
+ );
36
+ }
37
+ return <iconify-icon icon={link.icon}></iconify-icon>;
38
+ };
39
+
40
+ class Navbar extends Component {
41
+ render() {
42
+ const { siteUrl, menu, links, showSearch, searchTitle } = this.props;
43
+
44
+ return (
45
+ <nav class="navbar navbar-main" onclick="handleNavbarClick(event);">
46
+ <div class="navbar-container">
47
+ <a href={siteUrl} class="navbar-brand">
48
+ <svg
49
+ version="1.0"
50
+ xmlns="http://www.w3.org/2000/svg"
51
+ fill="var(--flamingo)"
52
+ viewBox="0 0 1182.000000 930.000000"
53
+ width="5em"
54
+ role="img"
55
+ aria-label="Blog Logo"
56
+ >
57
+ <g
58
+ transform="translate(0.000000,930.000000) scale(0.100000,-0.100000)"
59
+ stroke="none"
60
+ >
61
+ <path d="M4915 7175 c-238 -39 -533 -139 -794 -270 -549 -275 -1067 -758 -1291 -1205 -73 -145 -95 -225 -94 -345 0 -120 23 -188 86 -260 203 -231 774 -132 1521 262 185 97 298 161 372 209 l30 19 -19 -30 c-11 -16 -50 -74 -88 -130 l-69 -100 -102 -46 c-564 -253 -1269 -905 -1508 -1394 -118 -241 -121 -414 -9 -525 149 -150 390 -86 629 165 150 158 405 524 664 951 80 132 212 348 294 480 l148 239 70 24 c84 28 203 38 262 22 57 -16 100 -54 115 -102 20 -69 78 -90 123 -45 l24 24 15 -22 c9 -15 11 -28 5 -37 -16 -26 -9 -34 10 -11 12 13 31 22 48 22 39 0 46 6 88 78 73 125 268 348 406 464 115 98 227 147 230 101 3 -48 -7 -88 -58 -232 -91 -257 -76 -348 63 -374 88 -17 295 69 544 226 l135 85 5 -92 c10 -163 74 -226 232 -226 155 0 283 58 523 235 61 45 141 107 179 138 38 32 72 57 76 57 4 0 18 -31 30 -69 l22 -70 -79 -93 c-139 -162 -240 -309 -300 -433 -48 -101 -43 -157 17 -170 44 -10 77 15 91 67 18 70 161 276 292 423 l44 50 41 -37 c102 -92 323 -101 573 -22 97 30 292 121 394 184 98 60 293 207 306 231 17 33 7 80 -22 102 -35 25 -52 19 -136 -50 -232 -191 -517 -330 -761 -370 -130 -21 -200 -13 -248 29 -18 16 -34 36 -34 44 0 7 55 63 123 125 304 277 553 444 736 495 61 17 62 17 77 -4 10 -14 26 -22 45 -22 45 0 67 16 75 56 5 29 2 40 -17 61 -41 43 -92 63 -162 63 -174 0 -434 -158 -805 -491 -68 -61 -125 -109 -126 -107 -1 1 -17 34 -35 71 -34 70 -76 108 -133 122 -22 6 -36 -3 -99 -60 -97 -89 -338 -270 -433 -324 -144 -82 -255 -110 -304 -75 -44 30 -24 141 53 294 24 47 52 94 64 104 29 26 26 52 -8 87 -22 21 -39 29 -66 29 -49 0 -69 -12 -104 -63 -33 -48 -307 -240 -486 -340 -108 -60 -241 -117 -274 -117 -27 0 -26 12 5 85 99 233 127 382 85 462 -33 66 -73 88 -156 88 -106 -1 -183 -45 -337 -194 -43 -41 -78 -71 -78 -68 0 10 60 118 82 146 63 82 -57 168 -131 94 -33 -34 -137 -260 -241 -522 l-77 -194 -17 49 c-22 68 -63 115 -134 152 -70 37 -173 54 -266 45 l-60 -6 79 114 c143 210 249 343 339 429 229 217 236 225 242 257 5 26 1 37 -19 57 -16 16 -37 26 -54 26 -39 0 -142 -80 -250 -193 -99 -104 -201 -187 -378 -305 -429 -286 -1057 -565 -1435 -636 -95 -18 -257 -21 -315 -5 -51 14 -110 73 -124 124 -47 168 80 462 316 736 425 490 995 840 1638 1004 235 60 436 71 493 27 23 -17 27 -26 24 -61 -3 -52 9 -76 47 -89 60 -21 101 26 101 116 0 85 -34 132 -125 174 -45 20 -68 23 -215 25 -107 1 -197 -3 -255 -12z m-536 -2152 c-13 -21 -54 -87 -93 -148 -38 -60 -130 -211 -204 -335 -156 -261 -360 -571 -492 -750 -203 -275 -393 -411 -497 -356 -117 60 -104 230 34 458 176 292 619 737 985 990 88 61 271 177 281 177 5 1 -2 -16 -14 -36z" />{" "}
62
+ <path d="M7073 6016 c-60 -27 -83 -120 -42 -165 49 -53 119 -51 168 5 82 93 -11 212 -126 160z" />{" "}
63
+ </g>
64
+ </svg>
65
+ </a>
66
+ <div class="navbar-menu">
67
+ {Object.keys(menu).length ? (
68
+ <div class="navbar-start">
69
+ {Object.keys(menu).map((name) => {
70
+ const item = menu[name];
71
+ const navbar_item_class = `navbar-item ${item.active ? "is-active" : ""}`;
72
+ return (
73
+ <a class={navbar_item_class} href={item.url}>
74
+ {name}
75
+ </a>
76
+ );
77
+ })}
78
+ </div>
79
+ ) : null}
80
+ <div class="navbar-end">
81
+ <button
82
+ type="button"
83
+ class="navbar-item theme-selector-trigger"
84
+ title="Choose Theme"
85
+ >
86
+ <svg
87
+ xmlns="http://www.w3.org/2000/svg"
88
+ viewBox="0 0 14 14"
89
+ role="img"
90
+ aria-label="Theme Selector"
91
+ >
92
+ <g fill="none">
93
+ <path
94
+ fill="var(--red)"
95
+ d="M14 12.5v-3A1.5 1.5 0 0 0 12.5 8H3a3 3 0 1 0 0 6h9.5a1.5 1.5 0 0 0 1.5-1.5"
96
+ ></path>
97
+ <path
98
+ fill="var(--blue)"
99
+ d="M12.339 3.783L10.218 1.66a1.5 1.5 0 0 0-2.122 0L.88 8.88a3 3 0 0 0 4.24 4.24l7.218-7.217a1.5 1.5 0 0 0 0-2.121"
100
+ ></path>
101
+ <path
102
+ fill="var(--green)"
103
+ d="M4.5 0h-3A1.5 1.5 0 0 0 0 1.5V11a3 3 0 0 0 6 0V1.5A1.5 1.5 0 0 0 4.5 0"
104
+ ></path>
105
+ <path
106
+ fill="var(--base)"
107
+ fill-rule="evenodd"
108
+ d="M1.395 3.375a.625.625 0 1 0 0 1.25h3.21a.625.625 0 1 0 0-1.25zm0 4.5a.625.625 0 1 0 0 1.25h3.21a.625.625 0 1 0 0-1.25z"
109
+ clip-rule="evenodd"
110
+ ></path>
111
+ </g>
112
+ </svg>
113
+ </button>
114
+ {Object.keys(links).length ? (
115
+ <Fragment>
116
+ {Object.keys(links).map((name) => {
117
+ const link = links[name];
118
+ return (
119
+ <a
120
+ class="navbar-item"
121
+ target="_blank"
122
+ rel="noopener"
123
+ title={name}
124
+ href={link.url}
125
+ >
126
+ {renderLinkIcon(link)}
127
+ </a>
128
+ );
129
+ })}
130
+ </Fragment>
131
+ ) : null}
132
+ {showSearch ? (
133
+ <button
134
+ type="button"
135
+ class="navbar-item search"
136
+ title={searchTitle}
137
+ >
138
+ <svg
139
+ xmlns="http://www.w3.org/2000/svg"
140
+ viewBox="0 0 14 14"
141
+ role="img"
142
+ aria-label="Search Icon"
143
+ >
144
+ <g fill="none" fill-rule="evenodd" clip-rule="evenodd">
145
+ <path
146
+ fill="var(--lavender)"
147
+ d="M.5.125a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h4.756A4.5 4.5 0 0 1 5 9.625c0-1.271.527-2.42 1.375-3.238v-4.96A2 2 0 0 0 4.5.126zm7.125 1.303v4.105a4.5 4.5 0 0 1 6.347 3.584H14V.625a.5.5 0 0 0-.5-.5h-4a2 2 0 0 0-1.875 1.303"
148
+ />
149
+ <path
150
+ fill="var(--blue)"
151
+ d="M7.75 9.625a1.75 1.75 0 1 1 3.5 0a1.75 1.75 0 0 1-3.5 0m1.75-3.25a3.25 3.25 0 1 0 1.706 6.017l1.263 1.263a.75.75 0 0 0 1.06-1.06l-1.262-1.264A3.25 3.25 0 0 0 9.5 6.375"
152
+ />
153
+ </g>
154
+ </svg>
155
+ </button>
156
+ ) : null}
157
+ </div>
158
+ </div>
159
+ <button
160
+ type="button"
161
+ class="navbar-burger"
162
+ aria-label="menu"
163
+ aria-expanded="false"
164
+ >
165
+ <span aria-hidden="true"></span>
166
+ <span aria-hidden="true"></span>
167
+ <span aria-hidden="true"></span>
168
+ </button>
169
+ </div>
170
+ </nav>
171
+ );
172
+ }
173
+ }
174
+
175
+ module.exports = cacheComponent(Navbar, "common.navbar", (props) => {
176
+ const { config, helper, page } = props;
177
+ const { url_for, _p, __ } = helper;
178
+ const { logo, title, navbar, widgets, search } = config;
179
+
180
+ const hasTocWidget =
181
+ Array.isArray(widgets) && widgets.find((widget) => widget.type === "toc");
182
+ const showToc =
183
+ (config.toc === true || page.toc) &&
184
+ hasTocWidget &&
185
+ ["page", "post"].includes(page.layout);
186
+
187
+ const menu = {};
188
+ if (navbar?.menu) {
189
+ const pageUrl = typeof page.path !== "undefined" ? url_for(page.path) : "";
190
+ Object.keys(navbar.menu).forEach((name) => {
191
+ const url = url_for(navbar.menu[name]);
192
+ const active = isSameLink(url, pageUrl);
193
+ menu[name] = { url, active };
194
+ });
195
+ }
196
+
197
+ const links = {};
198
+ if (navbar?.links) {
199
+ Object.keys(navbar.links).forEach((name) => {
200
+ const link = navbar.links[name];
201
+ links[name] = {
202
+ url: url_for(typeof link === "string" ? link : link.url),
203
+ icon: link.icon,
204
+ };
205
+ });
206
+ }
207
+
208
+ return {
209
+ logo: url_for(logo),
210
+ siteUrl: url_for("/"),
211
+ siteTitle: title,
212
+ menu,
213
+ links,
214
+ showToc,
215
+ tocTitle: _p("widget.catalogue", Infinity),
216
+ showSearch: search?.type,
217
+ searchTitle: __("search.search"),
218
+ };
219
+ });
@@ -0,0 +1,39 @@
1
+ const {
2
+ Component,
3
+ Fragment,
4
+ loadComponent,
5
+ handleWidgetError,
6
+ } = require("../../include/util/common");
7
+
8
+ module.exports = class extends Component {
9
+ render() {
10
+ const { site, config, page, helper, head } = this.props;
11
+ const { plugins = [] } = config;
12
+
13
+ return (
14
+ <Fragment>
15
+ {Object.keys(plugins).map((name) => {
16
+ // plugin is not enabled
17
+ if (!plugins[name]) {
18
+ return null;
19
+ }
20
+ const Plugin = loadComponent(`plugin/${name}`);
21
+ if (!Plugin) {
22
+ handleWidgetError(`plugin "${name}"`);
23
+ return null;
24
+ }
25
+ return (
26
+ <Plugin
27
+ site={site}
28
+ config={config}
29
+ page={page}
30
+ helper={helper}
31
+ plugin={plugins[name]}
32
+ head={head}
33
+ />
34
+ );
35
+ })}
36
+ </Fragment>
37
+ );
38
+ }
39
+ };
@@ -0,0 +1,49 @@
1
+ const { Component, Fragment } = require("../../include/util/common");
2
+ const Plugins = require("./plugins");
3
+
4
+ module.exports = class extends Component {
5
+ render() {
6
+ const { site, config, helper, page } = this.props;
7
+
8
+ return (
9
+ <Fragment>
10
+ {config.comment?.js_url && (
11
+ <script defer src={config.comment.js_url}></script>
12
+ )}
13
+ <Plugins
14
+ site={site}
15
+ config={config}
16
+ page={page}
17
+ helper={helper}
18
+ head={false}
19
+ />
20
+ <script defer data-pjax src="/js/main.js"></script>
21
+ <script
22
+ defer
23
+ src="/js/host/medium-zoom/dist/medium-zoom.min.js"
24
+ ></script>
25
+ <script async src="/js/shiki/shiki.js"></script>
26
+ <script async src="/js/instant-page.min.js" type="module"></script>
27
+ {config.plugins.live2d_Asoul && (
28
+ <>
29
+ <script src="/js/live2d_Asoul/TweenLite.js" defer></script>
30
+ <script
31
+ src="/js/live2d_Asoul/live2dcubismcore.min.js"
32
+ defer
33
+ ></script>
34
+ <script src="/js/live2d_Asoul/pixi.min.js" defer></script>
35
+ <script src="/js/live2d_Asoul/cubism4.min.js" defer></script>
36
+ <script src="/js/live2d_Asoul/pio.js" defer></script>
37
+ <script src="/js/live2d_Asoul/pio_sdk4.js" defer></script>
38
+ <script src="/js/live2d_Asoul/load.js" defer></script>
39
+ <link
40
+ href="/js/live2d_Asoul/pio.css"
41
+ rel="stylesheet"
42
+ type="text/css"
43
+ />
44
+ </>
45
+ )}
46
+ </Fragment>
47
+ );
48
+ }
49
+ };
@@ -0,0 +1,22 @@
1
+ const {
2
+ Component,
3
+ loadComponent,
4
+ handleWidgetError,
5
+ } = require("../../include/util/common");
6
+
7
+ module.exports = class extends Component {
8
+ render() {
9
+ const { config, helper } = this.props;
10
+ const { search } = config;
11
+ if (!search || typeof search.type !== "string") {
12
+ return null;
13
+ }
14
+
15
+ const Search = loadComponent(`search/${search.type}`);
16
+ if (!Search) {
17
+ handleWidgetError(`search "${search.type}"`);
18
+ return null;
19
+ }
20
+ return <Search config={config} helper={helper} search={search} />;
21
+ }
22
+ };
@@ -0,0 +1,79 @@
1
+ const { Component, cacheComponent } = require("../../include/util/common");
2
+ class ThemeSelector extends Component {
3
+ render() {
4
+ return (
5
+ <div class="theme-selector-modal" id="theme-selector-modal">
6
+ <div class="theme-selector-backdrop"></div>
7
+ <div class="theme-selector-content">
8
+ <div class="theme-selector-header">
9
+ <h3 class="theme-selector-title">Choose Theme</h3>
10
+ <div class="theme-selector-hint">Shortcuts: ⌘ ⇧ P</div>
11
+ <div class="theme-selector-hint">
12
+ ↑↓ Navigate • 󰌑 Confirm • 󱊷 Close
13
+ </div>
14
+ </div>
15
+ <div class="theme-selector-list">
16
+ <div class="theme-option" data-theme-option="system" data-index="0">
17
+ <span class="theme-name">🖥️ System</span>
18
+ <span class="theme-check">
19
+ <iconify-icon icon="mingcute:check-fill"></iconify-icon>
20
+ </span>
21
+ </div>
22
+ <div class="theme-option" data-theme-option="latte" data-index="1">
23
+ <span class="theme-name">🌻 Latte</span>
24
+ <span class="theme-check">
25
+ <iconify-icon icon="mingcute:check-fill"></iconify-icon>
26
+ </span>
27
+ </div>
28
+ <div class="theme-option" data-theme-option="nord" data-index="2">
29
+ <span class="theme-name">🦭 Nord</span>
30
+ <span class="theme-check">
31
+ <iconify-icon icon="mingcute:check-fill"></iconify-icon>
32
+ </span>
33
+ </div>
34
+ <div
35
+ class="theme-option"
36
+ data-theme-option="nord_night"
37
+ data-index="3"
38
+ >
39
+ <span class="theme-name">🐻‍❄️ Nord Night</span>
40
+ <span class="theme-check">
41
+ <iconify-icon icon="mingcute:check-fill"></iconify-icon>
42
+ </span>
43
+ </div>
44
+ <div
45
+ class="theme-option"
46
+ data-theme-option="macchiato"
47
+ data-index="4"
48
+ >
49
+ <span class="theme-name">🌺 Macchiato</span>
50
+ <span class="theme-check">
51
+ <iconify-icon icon="mingcute:check-fill"></iconify-icon>
52
+ </span>
53
+ </div>
54
+ <div class="theme-option" data-theme-option="mocha" data-index="5">
55
+ <span class="theme-name">🌿 Mocha</span>
56
+ <span class="theme-check">
57
+ <iconify-icon icon="mingcute:check-fill"></iconify-icon>
58
+ </span>
59
+ </div>
60
+ <div
61
+ class="theme-option"
62
+ data-theme-option="tokyo_night"
63
+ data-index="6"
64
+ >
65
+ <span class="theme-name">🏙 Tokyo Night</span>
66
+ <span class="theme-check">
67
+ <iconify-icon icon="mingcute:check-fill"></iconify-icon>
68
+ </span>
69
+ </div>
70
+ </div>
71
+ </div>
72
+ </div>
73
+ );
74
+ }
75
+ }
76
+
77
+ module.exports = cacheComponent(ThemeSelector, "common.themeselector", () => {
78
+ return {};
79
+ });