hexo-theme-redefine-x 2.8.5

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 (319) hide show
  1. package/.github/ISSUE_TEMPLATE/bug-chinese.yml +115 -0
  2. package/.github/ISSUE_TEMPLATE/bug-english.yml +106 -0
  3. package/.github/ISSUE_TEMPLATE/enhancement-chinese.yml +55 -0
  4. package/.github/ISSUE_TEMPLATE/enhancement-english.yml +55 -0
  5. package/.github/workflows/build-and-commit.yml +49 -0
  6. package/.github/workflows/npm-publish.yml +34 -0
  7. package/.github/workflows/stale-issues.yml +20 -0
  8. package/CHANGELOG_REDEFINE_X.md +236 -0
  9. package/CODE_OF_CONDUCT.md +128 -0
  10. package/CONTRIBUTING.md +51 -0
  11. package/DONATION.md +82 -0
  12. package/LICENSE +674 -0
  13. package/README.md +135 -0
  14. package/README_zh-CN.md +138 -0
  15. package/README_zh-TW.md +137 -0
  16. package/TODO.md +215 -0
  17. package/_config.yml +489 -0
  18. package/languages/en.yml +93 -0
  19. package/languages/es.yml +92 -0
  20. package/languages/fr.yml +92 -0
  21. package/languages/ja.yml +92 -0
  22. package/languages/zh-CN.yml +95 -0
  23. package/languages/zh-TW.yml +94 -0
  24. package/layout/404.ejs +1 -0
  25. package/layout/archive.ejs +1 -0
  26. package/layout/category.ejs +1 -0
  27. package/layout/components/comments/comment.ejs +22 -0
  28. package/layout/components/comments/giscus.ejs +42 -0
  29. package/layout/components/comments/gitalk.ejs +47 -0
  30. package/layout/components/comments/twikoo.ejs +50 -0
  31. package/layout/components/comments/waline.ejs +34 -0
  32. package/layout/components/footer/footer.ejs +99 -0
  33. package/layout/components/header/head.ejs +222 -0
  34. package/layout/components/header/navbar.ejs +163 -0
  35. package/layout/components/header/preloader.ejs +148 -0
  36. package/layout/components/header/progress-bar.ejs +12 -0
  37. package/layout/components/plugins/aplayer.ejs +3 -0
  38. package/layout/components/scripts.ejs +90 -0
  39. package/layout/components/sidebar/author.ejs +6 -0
  40. package/layout/components/sidebar/avatar.ejs +3 -0
  41. package/layout/components/sidebar/statistics.ejs +14 -0
  42. package/layout/components/swup.ejs +27 -0
  43. package/layout/index.ejs +1 -0
  44. package/layout/layout.ejs +13 -0
  45. package/layout/page.ejs +57 -0
  46. package/layout/pages/archive/archive.ejs +3 -0
  47. package/layout/pages/bookmarks/bookmarks.ejs +68 -0
  48. package/layout/pages/category/categories.ejs +11 -0
  49. package/layout/pages/category/category-detail.ejs +6 -0
  50. package/layout/pages/friends/friends-link.ejs +59 -0
  51. package/layout/pages/home/home-article.ejs +52 -0
  52. package/layout/pages/home/home-background.ejs +33 -0
  53. package/layout/pages/home/home-banner.ejs +234 -0
  54. package/layout/pages/home/home-content.ejs +62 -0
  55. package/layout/pages/home/home-sidebar.ejs +78 -0
  56. package/layout/pages/masonry/masonry.ejs +28 -0
  57. package/layout/pages/notfound/notfound.ejs +8 -0
  58. package/layout/pages/page-template.ejs +23 -0
  59. package/layout/pages/post/article-content.ejs +153 -0
  60. package/layout/pages/post/article-copyright.ejs +69 -0
  61. package/layout/pages/post/article-info.ejs +78 -0
  62. package/layout/pages/post/post-tools.ejs +17 -0
  63. package/layout/pages/post/toc.ejs +15 -0
  64. package/layout/pages/shuoshuo/essays.ejs +23 -0
  65. package/layout/pages/tag/tag-detail.ejs +6 -0
  66. package/layout/pages/tag/tags.ejs +24 -0
  67. package/layout/post.ejs +1 -0
  68. package/layout/tag.ejs +1 -0
  69. package/layout/tags.ejs +1 -0
  70. package/layout/utils/image-viewer.ejs +3 -0
  71. package/layout/utils/local-search.ejs +20 -0
  72. package/layout/utils/paginator.ejs +8 -0
  73. package/layout/utils/posts-list.ejs +28 -0
  74. package/layout/utils/side-tools.ejs +51 -0
  75. package/package.json +45 -0
  76. package/scripts/config-export.js +66 -0
  77. package/scripts/data-handle.js +37 -0
  78. package/scripts/events/404.js +16 -0
  79. package/scripts/events/welcome.js +141 -0
  80. package/scripts/filters/delete-mask-handle.js +27 -0
  81. package/scripts/filters/encrypt.js +202 -0
  82. package/scripts/filters/img-handle.js +9 -0
  83. package/scripts/filters/lazyload-handle.js +350 -0
  84. package/scripts/filters/lib/hbe.default.js +15 -0
  85. package/scripts/filters/link-handle.js +42 -0
  86. package/scripts/filters/stylus-handle.js +9 -0
  87. package/scripts/filters/table-handle.js +11 -0
  88. package/scripts/helpers/meta-helpers.js +38 -0
  89. package/scripts/helpers/page-helpers.js +153 -0
  90. package/scripts/helpers/recommendation-helpers.js +367 -0
  91. package/scripts/helpers/theme-helpers.js +251 -0
  92. package/scripts/helpers/waline-helpers.js +33 -0
  93. package/scripts/modules/btn.js +85 -0
  94. package/scripts/modules/btns.js +71 -0
  95. package/scripts/modules/folding.js +34 -0
  96. package/scripts/modules/note-large.js +72 -0
  97. package/scripts/modules/note.js +64 -0
  98. package/scripts/modules/tabs.js +99 -0
  99. package/source/assets/hbe.style.css +220 -0
  100. package/source/assets/odometer-theme-minimal.css +81 -0
  101. package/source/css/build/tailwind.css +2 -0
  102. package/source/css/common/animated.styl +71 -0
  103. package/source/css/common/basic.styl +239 -0
  104. package/source/css/common/codeblock/code-block.styl +158 -0
  105. package/source/css/common/codeblock/code-theme.styl +82 -0
  106. package/source/css/common/codeblock/highlight.styl +189 -0
  107. package/source/css/common/codeblock/hljs-themes/dark/a11y-dark.styl +18 -0
  108. package/source/css/common/codeblock/hljs-themes/dark/agate.styl +18 -0
  109. package/source/css/common/codeblock/hljs-themes/dark/atom-one-dark.styl +18 -0
  110. package/source/css/common/codeblock/hljs-themes/dark/github-dark.styl +18 -0
  111. package/source/css/common/codeblock/hljs-themes/dark/monokai-sublime.styl +18 -0
  112. package/source/css/common/codeblock/hljs-themes/dark/night-owl.styl +18 -0
  113. package/source/css/common/codeblock/hljs-themes/dark/nord.styl +18 -0
  114. package/source/css/common/codeblock/hljs-themes/dark/tokyo-night-dark.styl +18 -0
  115. package/source/css/common/codeblock/hljs-themes/dark/vs2015.styl +18 -0
  116. package/source/css/common/codeblock/hljs-themes/light/atom-one-light.styl +18 -0
  117. package/source/css/common/codeblock/hljs-themes/light/default.styl +18 -0
  118. package/source/css/common/codeblock/hljs-themes/light/github.styl +18 -0
  119. package/source/css/common/colors.styl +112 -0
  120. package/source/css/common/markdown.styl +337 -0
  121. package/source/css/common/redefine-theme.styl +65 -0
  122. package/source/css/common/theme.styl +72 -0
  123. package/source/css/common/variables.styl +145 -0
  124. package/source/css/layout/_modules/aplayer.styl +799 -0
  125. package/source/css/layout/_modules/buttons.styl +42 -0
  126. package/source/css/layout/_modules/folding.styl +180 -0
  127. package/source/css/layout/_modules/notes.styl +181 -0
  128. package/source/css/layout/_modules/tabs.styl +105 -0
  129. package/source/css/layout/_partials/404.styl +14 -0
  130. package/source/css/layout/_partials/archive-list.styl +49 -0
  131. package/source/css/layout/_partials/article-copyright-info.styl +27 -0
  132. package/source/css/layout/_partials/article-meta-info.styl +62 -0
  133. package/source/css/layout/_partials/comments/comment.styl +11 -0
  134. package/source/css/layout/_partials/comments/gitalk.styl +529 -0
  135. package/source/css/layout/_partials/comments/twikoo.styl +62 -0
  136. package/source/css/layout/_partials/comments/waline.styl +1151 -0
  137. package/source/css/layout/_partials/footer.styl +59 -0
  138. package/source/css/layout/_partials/home-banner.styl +48 -0
  139. package/source/css/layout/_partials/image-viewer.styl +37 -0
  140. package/source/css/layout/_partials/local-search.styl +137 -0
  141. package/source/css/layout/_partials/navbar.styl +309 -0
  142. package/source/css/layout/_partials/page-template.styl +147 -0
  143. package/source/css/layout/_partials/paginator.styl +65 -0
  144. package/source/css/layout/_partials/post-tools.styl +43 -0
  145. package/source/css/layout/_partials/progress-bar.styl +33 -0
  146. package/source/css/layout/_partials/side-tools.styl +87 -0
  147. package/source/css/layout/_partials/tagcloud.styl +136 -0
  148. package/source/css/layout/_partials/toc.styl +105 -0
  149. package/source/css/layout/animations.styl +42 -0
  150. package/source/css/layout/archive-content.styl +8 -0
  151. package/source/css/layout/article-content.styl +257 -0
  152. package/source/css/layout/bookmarks.styl +8 -0
  153. package/source/css/layout/category-content.styl +21 -0
  154. package/source/css/layout/category-list.styl +119 -0
  155. package/source/css/layout/home-content.styl +114 -0
  156. package/source/css/layout/home-sidebar.styl +126 -0
  157. package/source/css/layout/page.styl +144 -0
  158. package/source/css/layout/tag-content.styl +30 -0
  159. package/source/css/style.styl +26 -0
  160. package/source/css/tailwind.source.css +236 -0
  161. package/source/fontawesome/all.min.css +6 -0
  162. package/source/fontawesome/brands.min.css +6 -0
  163. package/source/fontawesome/duotone.min.css +6 -0
  164. package/source/fontawesome/fontawesome.min.css +6 -0
  165. package/source/fontawesome/light.min.css +6 -0
  166. package/source/fontawesome/regular.min.css +6 -0
  167. package/source/fontawesome/sharp-solid.min.css +6 -0
  168. package/source/fontawesome/solid.min.css +6 -0
  169. package/source/fontawesome/svg-with-js.min.css +6 -0
  170. package/source/fontawesome/thin.min.css +6 -0
  171. package/source/fontawesome/v4-font-face.min.css +6 -0
  172. package/source/fontawesome/v4-shims.min.css +6 -0
  173. package/source/fontawesome/v5-font-face.min.css +6 -0
  174. package/source/fonts/Chillax/Chillax-Variable.eot +0 -0
  175. package/source/fonts/Chillax/Chillax-Variable.ttf +0 -0
  176. package/source/fonts/Chillax/Chillax-Variable.woff +0 -0
  177. package/source/fonts/Chillax/Chillax-Variable.woff2 +0 -0
  178. package/source/fonts/Chillax/chillax.css +39 -0
  179. package/source/fonts/Geist/GeistVF.ttf +0 -0
  180. package/source/fonts/Geist/GeistVF.woff +0 -0
  181. package/source/fonts/Geist/GeistVF.woff2 +0 -0
  182. package/source/fonts/Geist/geist.css +16 -0
  183. package/source/fonts/GeistMono/GeistMonoVF.ttf +0 -0
  184. package/source/fonts/GeistMono/GeistMonoVF.woff +0 -0
  185. package/source/fonts/GeistMono/GeistMonoVF.woff2 +0 -0
  186. package/source/fonts/GeistMono/geist-mono.css +16 -0
  187. package/source/images/bookmark-placeholder.svg +9 -0
  188. package/source/images/loading.svg +5 -0
  189. package/source/images/redefine-avatar.svg +1 -0
  190. package/source/images/redefine-favicon.svg +1 -0
  191. package/source/images/redefine-logo.svg +1 -0
  192. package/source/images/redefine-logo.webp +0 -0
  193. package/source/images/redefine-og.webp +0 -0
  194. package/source/images/wallhaven-wqery6-dark.webp +0 -0
  195. package/source/images/wallhaven-wqery6-light.webp +0 -0
  196. package/source/js/build/layouts/bookmarkNav.js +2 -0
  197. package/source/js/build/layouts/bookmarkNav.js.map +1 -0
  198. package/source/js/build/layouts/categoryList.js +2 -0
  199. package/source/js/build/layouts/categoryList.js.map +1 -0
  200. package/source/js/build/layouts/essays.js +2 -0
  201. package/source/js/build/layouts/essays.js.map +1 -0
  202. package/source/js/build/layouts/lazyload.js +2 -0
  203. package/source/js/build/layouts/lazyload.js.map +1 -0
  204. package/source/js/build/layouts/navbarShrink.js +2 -0
  205. package/source/js/build/layouts/navbarShrink.js.map +1 -0
  206. package/source/js/build/layouts/toc.js +2 -0
  207. package/source/js/build/layouts/toc.js.map +1 -0
  208. package/source/js/build/libs/APlayer.min.js +2 -0
  209. package/source/js/build/libs/Swup.min.js +2 -0
  210. package/source/js/build/libs/SwupPreloadPlugin.min.js +1 -0
  211. package/source/js/build/libs/SwupProgressPlugin.min.js +1 -0
  212. package/source/js/build/libs/SwupScriptsPlugin.min.js +1 -0
  213. package/source/js/build/libs/SwupScrollPlugin.min.js +1 -0
  214. package/source/js/build/libs/SwupSlideTheme.min.js +1 -0
  215. package/source/js/build/libs/Typed.min.js +10 -0
  216. package/source/js/build/libs/anime.min.js +8 -0
  217. package/source/js/build/libs/mermaid.min.js +2314 -0
  218. package/source/js/build/libs/minimasonry.min.js +1 -0
  219. package/source/js/build/libs/moment-with-locales.min.js +2 -0
  220. package/source/js/build/libs/moment.min.js +2 -0
  221. package/source/js/build/libs/odometer.min.js +2 -0
  222. package/source/js/build/libs/pangu.min.js +9 -0
  223. package/source/js/build/libs/pjax.min.js +1 -0
  224. package/source/js/build/libs/waline.js +84 -0
  225. package/source/js/build/main.js +2 -0
  226. package/source/js/build/main.js.map +1 -0
  227. package/source/js/build/plugins/aplayer.js +2 -0
  228. package/source/js/build/plugins/aplayer.js.map +1 -0
  229. package/source/js/build/plugins/hbe.js +2 -0
  230. package/source/js/build/plugins/hbe.js.map +1 -0
  231. package/source/js/build/plugins/masonry.js +2 -0
  232. package/source/js/build/plugins/masonry.js.map +1 -0
  233. package/source/js/build/plugins/mermaid.js +2 -0
  234. package/source/js/build/plugins/mermaid.js.map +1 -0
  235. package/source/js/build/plugins/pangu.js +2 -0
  236. package/source/js/build/plugins/pangu.js.map +1 -0
  237. package/source/js/build/plugins/tabs.js +2 -0
  238. package/source/js/build/plugins/tabs.js.map +1 -0
  239. package/source/js/build/plugins/typed.js +2 -0
  240. package/source/js/build/plugins/typed.js.map +1 -0
  241. package/source/js/build/tools/codeBlock.js +2 -0
  242. package/source/js/build/tools/codeBlock.js.map +1 -0
  243. package/source/js/build/tools/imageViewer.js +2 -0
  244. package/source/js/build/tools/imageViewer.js.map +1 -0
  245. package/source/js/build/tools/lightDarkSwitch.js +2 -0
  246. package/source/js/build/tools/lightDarkSwitch.js.map +1 -0
  247. package/source/js/build/tools/localSearch.js +2 -0
  248. package/source/js/build/tools/localSearch.js.map +1 -0
  249. package/source/js/build/tools/runtime.js +2 -0
  250. package/source/js/build/tools/runtime.js.map +1 -0
  251. package/source/js/build/tools/scrollTopBottom.js +2 -0
  252. package/source/js/build/tools/scrollTopBottom.js.map +1 -0
  253. package/source/js/build/tools/tocToggle.js +2 -0
  254. package/source/js/build/tools/tocToggle.js.map +1 -0
  255. package/source/js/build/utils.js +2 -0
  256. package/source/js/build/utils.js.map +1 -0
  257. package/source/js/build.js +148 -0
  258. package/source/js/layouts/bookmarkNav.js +65 -0
  259. package/source/js/layouts/categoryList.js +53 -0
  260. package/source/js/layouts/essays.js +25 -0
  261. package/source/js/layouts/lazyload.js +199 -0
  262. package/source/js/layouts/navbarShrink.js +135 -0
  263. package/source/js/layouts/toc.js +115 -0
  264. package/source/js/libs/APlayer.min.js +2 -0
  265. package/source/js/libs/APlayer.min.js.map +1 -0
  266. package/source/js/libs/Swup.min.js +2 -0
  267. package/source/js/libs/Swup.min.js.map +1 -0
  268. package/source/js/libs/SwupPreloadPlugin.min.js +1 -0
  269. package/source/js/libs/SwupPreloadPlugin.min.js.map +1 -0
  270. package/source/js/libs/SwupProgressPlugin.min.js +1 -0
  271. package/source/js/libs/SwupScriptsPlugin.min.js +1 -0
  272. package/source/js/libs/SwupScrollPlugin.min.js +1 -0
  273. package/source/js/libs/SwupScrollPlugin.min.js.map +1 -0
  274. package/source/js/libs/SwupSlideTheme.min.js +1 -0
  275. package/source/js/libs/Typed.min.js +10 -0
  276. package/source/js/libs/anime.min.js +8 -0
  277. package/source/js/libs/mermaid.min.js +2314 -0
  278. package/source/js/libs/mermaid.min.js.map +7 -0
  279. package/source/js/libs/minimasonry.min.js +1 -0
  280. package/source/js/libs/moment-with-locales.min.js +2 -0
  281. package/source/js/libs/moment.min.js +2 -0
  282. package/source/js/libs/odometer.min.js +2 -0
  283. package/source/js/libs/pangu.min.js +9 -0
  284. package/source/js/libs/pjax.min.js +1 -0
  285. package/source/js/libs/waline.js +84 -0
  286. package/source/js/libs/waline.js.map +1 -0
  287. package/source/js/main.js +95 -0
  288. package/source/js/plugins/aplayer.js +33 -0
  289. package/source/js/plugins/hbe.js +350 -0
  290. package/source/js/plugins/masonry.js +115 -0
  291. package/source/js/plugins/mermaid.js +7 -0
  292. package/source/js/plugins/pangu.js +12 -0
  293. package/source/js/plugins/tabs.js +29 -0
  294. package/source/js/plugins/typed.js +62 -0
  295. package/source/js/tools/codeBlock.js +48 -0
  296. package/source/js/tools/imageViewer.js +194 -0
  297. package/source/js/tools/lightDarkSwitch.js +165 -0
  298. package/source/js/tools/localSearch.js +327 -0
  299. package/source/js/tools/runtime.js +28 -0
  300. package/source/js/tools/scrollTopBottom.js +34 -0
  301. package/source/js/tools/tocToggle.js +58 -0
  302. package/source/js/utils.js +383 -0
  303. package/source/webfonts/fa-brands-400.ttf +0 -0
  304. package/source/webfonts/fa-brands-400.woff2 +0 -0
  305. package/source/webfonts/fa-duotone-900.ttf +0 -0
  306. package/source/webfonts/fa-duotone-900.woff2 +0 -0
  307. package/source/webfonts/fa-light-300.ttf +0 -0
  308. package/source/webfonts/fa-light-300.woff2 +0 -0
  309. package/source/webfonts/fa-regular-400.ttf +0 -0
  310. package/source/webfonts/fa-regular-400.woff2 +0 -0
  311. package/source/webfonts/fa-sharp-solid-900.ttf +0 -0
  312. package/source/webfonts/fa-sharp-solid-900.woff2 +0 -0
  313. package/source/webfonts/fa-solid-900.ttf +0 -0
  314. package/source/webfonts/fa-solid-900.woff2 +0 -0
  315. package/source/webfonts/fa-thin-100.ttf +0 -0
  316. package/source/webfonts/fa-thin-100.woff2 +0 -0
  317. package/source/webfonts/fa-v4compatibility.ttf +0 -0
  318. package/source/webfonts/fa-v4compatibility.woff2 +0 -0
  319. package/vercel.json +7 -0
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Single Button module for Hexo theme Redefine
5
+ * Creates standalone button elements
6
+ */
7
+
8
+ /**
9
+ * Creates a single button
10
+ *
11
+ * @param {Array} args - Button arguments (class, text, url, icon)
12
+ * @returns {String} HTML for a single button
13
+ */
14
+ function postBtn(args) {
15
+ // Parse arguments - support both '::' and ',' as separators
16
+ let parsedArgs;
17
+ const argsStr = args.join(" ");
18
+
19
+ if (argsStr.includes("::")) {
20
+ parsedArgs = argsStr.split("::");
21
+ } else {
22
+ parsedArgs = argsStr.split(",");
23
+ }
24
+
25
+ // Default values
26
+ let cls = "";
27
+ let text = "";
28
+ let url = "";
29
+ let icon = "";
30
+
31
+ // Parse arguments based on count
32
+ switch(parsedArgs.length) {
33
+ case 4: // class, text, url, icon
34
+ cls = parsedArgs[0];
35
+ text = parsedArgs[1];
36
+ url = parsedArgs[2];
37
+ icon = parsedArgs[3];
38
+ break;
39
+
40
+ case 3:
41
+ // Check if third arg is an icon (contains fa-)
42
+ if (parsedArgs[2].includes("fa-")) {
43
+ // text, url, icon
44
+ text = parsedArgs[0];
45
+ url = parsedArgs[1];
46
+ icon = parsedArgs[2];
47
+ } else {
48
+ // class, text, url
49
+ cls = parsedArgs[0];
50
+ text = parsedArgs[1];
51
+ url = parsedArgs[2];
52
+ }
53
+ break;
54
+
55
+ case 2: // text, url
56
+ text = parsedArgs[0];
57
+ url = parsedArgs[1];
58
+ break;
59
+
60
+ case 1: // text only
61
+ text = parsedArgs[0];
62
+ break;
63
+ }
64
+
65
+ // Clean up values
66
+ cls = cls.trim();
67
+ icon = icon.trim();
68
+ text = text.trim();
69
+ url = url.trim();
70
+
71
+ // Build attributes
72
+ const hrefAttr = url ? `href='${url}'` : '';
73
+ const classAttr = cls ? `${cls}` : '';
74
+
75
+ // Build button HTML
76
+ if (icon) {
77
+ return `<a class="button ${classAttr}" ${hrefAttr} title='${text}'><i class='${icon}'></i> ${text}</a>`;
78
+ }
79
+
80
+ return `<a class="button ${classAttr}" ${hrefAttr} title='${text}'>${text}</a>`;
81
+ }
82
+
83
+ // Register Hexo tags
84
+ hexo.extend.tag.register("btn", postBtn);
85
+ hexo.extend.tag.register("button", postBtn);
@@ -0,0 +1,71 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Buttons module for Hexo theme Redefine
5
+ * Creates button containers and button elements
6
+ */
7
+
8
+ /**
9
+ * Creates a buttons container
10
+ *
11
+ * @param {Array} args - Class names for the container
12
+ * @param {String} content - Button content (cells)
13
+ * @returns {String} HTML for the buttons container
14
+ */
15
+ function postBtns(args, content) {
16
+ const classes = args.join(' ');
17
+ return `<div class="btns ${classes}">
18
+ ${content}
19
+ </div>`;
20
+ }
21
+
22
+ /**
23
+ * Creates a single button cell
24
+ *
25
+ * @param {Array} args - Button properties (text, url, icon/image)
26
+ * @returns {String} HTML for a single button
27
+ */
28
+ function postCell(args, content) {
29
+ // Parse arguments - support both '::' and ',' as separators
30
+ let parsedArgs;
31
+ const argsStr = args.join(' ');
32
+
33
+ if (argsStr.includes('::')) {
34
+ parsedArgs = argsStr.split('::');
35
+ } else {
36
+ parsedArgs = argsStr.split(',');
37
+ }
38
+
39
+ // Extract button properties
40
+ const text = (parsedArgs[0] || '').trim();
41
+ const url = (parsedArgs[1] || '').trim();
42
+ const buttonClasses = ['button'];
43
+
44
+ // Handle URL
45
+ const hrefAttr = url ? `href='${url}'` : '';
46
+
47
+ // Handle icon or image
48
+ let iconOrImage = '';
49
+
50
+ if (parsedArgs.length > 2) {
51
+ const iconOrImgSrc = parsedArgs[2].trim();
52
+
53
+ // Check if it's a FontAwesome icon
54
+ if (iconOrImgSrc.includes('fa-')) {
55
+ iconOrImage = `<i class='${iconOrImgSrc}'></i> `;
56
+ } else {
57
+ // Use specified image or default
58
+ const imgSrc = iconOrImgSrc || hexo.theme.config.default.image;
59
+ iconOrImage = `<img src='${imgSrc}'>`;
60
+ }
61
+ }
62
+
63
+ // Return complete button HTML
64
+ return `<a class="${buttonClasses.join(' ')}" ${hrefAttr} title='${text}'>${iconOrImage}${text}</a>`;
65
+ }
66
+
67
+ // Register Hexo tags
68
+ hexo.extend.tag.register('btns', postBtns, {ends: true});
69
+ hexo.extend.tag.register('buttons', postBtns, {ends: true});
70
+ hexo.extend.tag.register('cell', postCell);
71
+
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ const postFolding = (args, content) => {
4
+ // Parse arguments - support both '::' and ',' as delimiters
5
+ const delimiter = args.join(' ').includes('::') ? '::' : ',';
6
+ const [style, title = ''] = args.join(' ').split(delimiter).map(arg => arg.trim());
7
+
8
+ // Render markdown content
9
+ const renderedContent = hexo.render.renderSync({
10
+ text: content,
11
+ engine: 'markdown'
12
+ });
13
+
14
+ // Replace heading tags with paragraph tags that have heading classes
15
+ const processedContent = renderedContent.replace(
16
+ /<(h[1-6])>/g,
17
+ (_, tag) => `<p class='${tag}'>`
18
+ ).replace(
19
+ /<\/(h[1-6])>/g,
20
+ () => '</p>'
21
+ );
22
+
23
+ // Build the HTML with or without custom style
24
+ const styleAttr = style ? ` class="${style}"` : '';
25
+
26
+ return `<details${styleAttr} data-header-exclude>
27
+ <summary><i class="fa-solid fa-chevron-right"></i>${title} </summary>
28
+ <div class='content markdown-body'>
29
+ ${processedContent}
30
+ </div>
31
+ </details>`;
32
+ };
33
+
34
+ hexo.extend.tag.register('folding', postFolding, {ends: true});
@@ -0,0 +1,72 @@
1
+ function postNoteLarge(args, content) {
2
+ if (args.length === 0) {
3
+ args.push("default", "Warning");
4
+ }
5
+
6
+ let icon = "";
7
+ let title = "";
8
+
9
+ // Extract color from args[0]
10
+ const color = args[0];
11
+
12
+ // Process all arguments after color to build icon and title
13
+ const remainingArgs = args.slice(1);
14
+
15
+ // Find all fa- prefixed arguments
16
+ const faArgs = [];
17
+ const faIndices = [];
18
+
19
+ remainingArgs.forEach((arg, index) => {
20
+ if (arg && arg.startsWith('fa-')) {
21
+ faArgs.push(arg);
22
+ faIndices.push(index);
23
+ }
24
+ });
25
+
26
+ // Handle FontAwesome icons based on how many fa- args we found
27
+ if (faArgs.length === 2) {
28
+ // Two fa- args: first is style, second is icon
29
+ icon = `<i class="notel-icon ${faArgs[0]} ${faArgs[1]}"></i>`;
30
+
31
+ // Remove both FA args (remove higher index first to preserve positions)
32
+ remainingArgs.splice(faIndices[1], 1);
33
+ remainingArgs.splice(faIndices[0], 1);
34
+ } else if (faArgs.length === 1) {
35
+ // One fa- arg: it's the icon, default to fa-solid
36
+ icon = `<i class="notel-icon fa-solid ${faArgs[0]}"></i>`;
37
+
38
+ // Remove the FA arg
39
+ remainingArgs.splice(faIndices[0], 1);
40
+ }
41
+
42
+ // Join all remaining args as the title
43
+ title = remainingArgs.join(" ");
44
+
45
+ // If no title was provided, set a default
46
+ if (!title) {
47
+ title = "Note";
48
+ }
49
+
50
+ return `
51
+ <div class="note-large ${color}">
52
+ <div class="notel-title rounded-t-lg p-3 font-bold text-lg flex flex-row gap-2 items-center">
53
+ ${icon}${hexo.render.renderSync({
54
+ text: title,
55
+ engine: "markdown",
56
+ })}
57
+ </div>
58
+ <div class="notel-content markdown-body">
59
+ ${hexo.render.renderSync({
60
+ text: content,
61
+ engine: "markdown",
62
+ })}
63
+ </div>
64
+ </div>`;
65
+ }
66
+
67
+ hexo.extend.tag.register("noteL", postNoteLarge, { ends: true });
68
+ hexo.extend.tag.register("notel", postNoteLarge, { ends: true });
69
+ hexo.extend.tag.register("notelarge", postNoteLarge, { ends: true });
70
+ hexo.extend.tag.register("notel-large", postNoteLarge, { ends: true });
71
+ hexo.extend.tag.register("notes-large", postNoteLarge, { ends: true });
72
+ hexo.extend.tag.register("subwarning", postNoteLarge, { ends: true });
@@ -0,0 +1,64 @@
1
+ function postNote(args, content) {
2
+ if (args.length === 0) {
3
+ args.push("default");
4
+ }
5
+
6
+ let icon = "";
7
+
8
+ // Extract style classes from all args except potential icon classes
9
+ let classes = [];
10
+ const remainingArgs = [...args]; // Copy args array
11
+
12
+ // Add first arg as main class
13
+ if (remainingArgs.length > 0) {
14
+ classes.push(remainingArgs[0]);
15
+ remainingArgs.shift();
16
+ }
17
+
18
+ // Find all fa- prefixed arguments
19
+ const faArgs = [];
20
+ const faIndices = [];
21
+
22
+ remainingArgs.forEach((arg, index) => {
23
+ if (arg && arg.startsWith('fa-')) {
24
+ faArgs.push(arg);
25
+ faIndices.push(index);
26
+ }
27
+ });
28
+
29
+ // Handle FontAwesome icons based on how many fa- args we found
30
+ if (faArgs.length === 2) {
31
+ // Two fa- args: first is style, second is icon
32
+ icon = `<i class="note-icon ${faArgs[0]} ${faArgs[1]}"></i>`;
33
+
34
+ // Remove both FA args (remove higher index first to preserve positions)
35
+ remainingArgs.splice(faIndices[1], 1);
36
+ remainingArgs.splice(faIndices[0], 1);
37
+ } else if (faArgs.length === 1) {
38
+ // One fa- arg: it's the icon, default to fa-solid
39
+ icon = `<i class="note-icon fa-solid ${faArgs[0]}"></i>`;
40
+
41
+ // Remove the FA arg
42
+ remainingArgs.splice(faIndices[0], 1);
43
+ }
44
+
45
+ // Add any remaining args as additional classes
46
+ classes = classes.concat(remainingArgs);
47
+
48
+ // Add icon-padding class if icon exists
49
+ if (icon) {
50
+ classes.push("icon-padding");
51
+ }
52
+
53
+ return `
54
+ <div class="note p-4 mb-4 rounded-small markdown-body ${classes.join(" ")}">
55
+ ${icon}${hexo.render.renderSync({
56
+ text: content,
57
+ engine: "markdown",
58
+ })}
59
+ </div>`;
60
+ }
61
+
62
+ hexo.extend.tag.register("note", postNote, { ends: true });
63
+ hexo.extend.tag.register("notes", postNote, { ends: true });
64
+ hexo.extend.tag.register("subnote", postNote, { ends: true });
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Module: Tabs
3
+ * hexo-theme-redefine
4
+ * By Evan
5
+ */
6
+
7
+ 'use strict';
8
+
9
+ const TAB_BLOCK_REGEX = /<!--\s*tab (.*?)\s*-->\n([\w\W\s\S]*?)<!--\s*endtab\s*-->/g;
10
+ const APLAYER_TAG_REGEX = /\<div.*class=\"aplayer aplayer-tag-marker\"(.|\n)*\<\/script\>/g;
11
+ const FANCYBOX_TAG_REGEX = /\<div.*galleryFlag(.|\n)*\<\/span\>\<\/div\>\<\/div\>/g;
12
+
13
+ function parseArgs(args) {
14
+ if (/::/g.test(args)) {
15
+ return args.join(' ').split('::');
16
+ } else {
17
+ return args.join(' ').split(',');
18
+ }
19
+ }
20
+
21
+ function extractMatches(content) {
22
+ const matches = [];
23
+ let match;
24
+
25
+ while ((match = TAB_BLOCK_REGEX.exec(content)) !== null) {
26
+ matches.push(match[1]);
27
+ matches.push(match[2]);
28
+ }
29
+
30
+ return matches;
31
+ }
32
+
33
+ function processAplayerTag(content) {
34
+ let aplayerTag = 0;
35
+
36
+ if (/class="aplayer aplayer-tag-marker"/g.test(content)) {
37
+ aplayerTag = APLAYER_TAG_REGEX.exec(content)[0];
38
+ content = content.replace(APLAYER_TAG_REGEX, "@aplayerTag@");
39
+ }
40
+
41
+ return { content, aplayerTag };
42
+ }
43
+
44
+ function processFancyboxTag(content) {
45
+ let fancyboxTag = 0;
46
+
47
+ if (/galleryFlag/g.test(content)) {
48
+ fancyboxTag = FANCYBOX_TAG_REGEX.exec(content)[0];
49
+ content = content.replace(FANCYBOX_TAG_REGEX, "@fancyboxTag@");
50
+ }
51
+
52
+ return { content, fancyboxTag };
53
+ }
54
+
55
+ function buildTabNavAndContent(matches, tabName, tabActive) {
56
+ let tabNav = '';
57
+ let tabContent = '';
58
+
59
+ for (let i = 0; i < matches.length; i += 2) {
60
+ const tabParameters = matches[i].split('@');
61
+ const postContent = matches[i + 1];
62
+ const tabCaption = tabParameters[0] || '';
63
+ const tabIcon = tabParameters[1] || '';
64
+ const tabHref = (tabName + ' ' + (i / 2 + 1)).toLowerCase().split(' ').join('-');
65
+
66
+ const { content: contentWithAplayerTag, aplayerTag } = processAplayerTag(postContent);
67
+ const { content: contentWithFancyboxTag, fancyboxTag } = processFancyboxTag(contentWithAplayerTag);
68
+
69
+ const renderedContent = hexo.render.renderSync({ text: contentWithFancyboxTag, engine: 'markdown' }).trim();
70
+
71
+ const finalContent = renderedContent.replace(/\<pre\>\<code\>.*@aplayerTag@.*\<\/code><\/pre>/, aplayerTag)
72
+ .replace(/.*@fancyboxTag@.*/, fancyboxTag);
73
+
74
+ const isActive = (tabActive > 0 && tabActive === (i / 2 + 1)) || (tabActive === 0 && i === 0) ? ' active' : '';
75
+
76
+ tabNav += `<li class="tab${isActive}"><a class="#${tabHref}">${tabIcon + tabCaption.trim()}</a></li>`;
77
+ tabContent += `<div class="tab-pane${isActive}" id="${tabHref}">${finalContent}</div>`;
78
+ }
79
+
80
+ return { tabNav, tabContent };
81
+ }
82
+
83
+ function postTabs(args, content) {
84
+ const [tabName, tabActive] = parseArgs(args);
85
+ const activeTabIndex = Number(tabActive) || 0;
86
+
87
+ !tabName && hexo.log.warn('Tabs block must have unique name!');
88
+
89
+ const matches = extractMatches(content);
90
+ const { tabNav, tabContent } = buildTabNavAndContent(matches, tabName, activeTabIndex);
91
+
92
+ const finalTabNav = `<ul class="nav-tabs">${tabNav}</ul>`;
93
+ const finalTabContent = `<div class="tab-content">${tabContent}</div>`;
94
+ return `<div class="tabs" id="tab-${tabName.toLowerCase().split(' ').join('-')}">${finalTabNav + finalTabContent}</div>`;
95
+ }
96
+
97
+ hexo.extend.tag.register('tabs', postTabs, { ends: true });
98
+ hexo.extend.tag.register('subtabs', postTabs, { ends: true });
99
+ hexo.extend.tag.register('subsubtabs', postTabs, { ends: true });
@@ -0,0 +1,220 @@
1
+ .hbe,
2
+ .hbe:after,
3
+ .hbe:before {
4
+ -webkit-box-sizing: border-box;
5
+ -moz-box-sizing: border-box;
6
+ box-sizing: border-box;
7
+ }
8
+
9
+ .hbe-container{
10
+ margin: 0 auto;
11
+ overflow: hidden;
12
+ }
13
+ .hbe-content {
14
+ text-align: center;
15
+ font-size: 150%;
16
+ padding: 1em 0;
17
+ }
18
+
19
+ .hbe-input {
20
+ position: relative;
21
+ z-index: 1;
22
+ display: inline-block;
23
+ margin: 1em;
24
+ width: 80%;
25
+ min-width: 200px;
26
+ vertical-align: top;
27
+ }
28
+
29
+ .hbe-input-field {
30
+ line-height: normal;
31
+ font-size: 100%;
32
+ margin: 0;
33
+ position: relative;
34
+ display: block;
35
+ float: right;
36
+ padding: 0.8em;
37
+ width: 60%;
38
+ border: none;
39
+ border-radius: 0;
40
+ background: #f0f0f0;
41
+ color: #aaa;
42
+ font-weight: 400;
43
+ font-family: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
44
+ -webkit-appearance: none; /* for box shadows to show on iOS */
45
+ }
46
+
47
+ .hbe-input-field:focus {
48
+ outline: none;
49
+ }
50
+
51
+ .hbe-input-label {
52
+ display: inline-block;
53
+ float: right;
54
+ padding: 0 1em;
55
+ width: 40%;
56
+ color: #696969;
57
+ font-weight: bold;
58
+ font-size: 70.25%;
59
+ -webkit-font-smoothing: antialiased;
60
+ -moz-osx-font-smoothing: grayscale;
61
+ -webkit-touch-callout: none;
62
+ -webkit-user-select: none;
63
+ -khtml-user-select: none;
64
+ -moz-user-select: none;
65
+ -ms-user-select: none;
66
+ user-select: none;
67
+ }
68
+
69
+ .hbe-input-label-content {
70
+ position: relative;
71
+ display: block;
72
+ padding: 1.6em 0;
73
+ width: 100%;
74
+ }
75
+
76
+ .hbe-graphic {
77
+ position: absolute;
78
+ top: 0;
79
+ left: 0;
80
+ fill: none;
81
+ }
82
+
83
+ /* hbe button in post page */
84
+ .hbe-button {
85
+ width: 130px;
86
+ height: 40px;
87
+ background: linear-gradient(to bottom, #4eb5e5 0%,#389ed5 100%); /* W3C */
88
+ border: none;
89
+ border-radius: 5px;
90
+ position: relative;
91
+ border-bottom: 4px solid #2b8bc6;
92
+ color: #fbfbfb;
93
+ font-weight: 600;
94
+ font-family: 'Open Sans', sans-serif;
95
+ text-shadow: 1px 1px 1px rgba(0,0,0,.4);
96
+ font-size: 15px;
97
+ text-align: left;
98
+ text-indent: 5px;
99
+ box-shadow: 0px 3px 0px 0px rgba(0,0,0,.2);
100
+ cursor: pointer;
101
+
102
+ display: block;
103
+ margin: 0 auto;
104
+ margin-bottom: 20px;
105
+ }
106
+
107
+ .hbe-button:active {
108
+ box-shadow: 0px 2px 0px 0px rgba(0,0,0,.2);
109
+ top: 1px;
110
+ }
111
+
112
+ .hbe-button:after {
113
+ content: "";
114
+ width: 0;
115
+ height: 0;
116
+ display: block;
117
+ border-top: 20px solid #187dbc;
118
+ border-bottom: 20px solid #187dbc;
119
+ border-left: 16px solid transparent;
120
+ border-right: 20px solid #187dbc;
121
+ position: absolute;
122
+ opacity: 0.6;
123
+ right: 0;
124
+ top: 0;
125
+ border-radius: 0 5px 5px 0;
126
+ }
127
+ /* hbe button in post page */
128
+
129
+ /* default theme {{{ */
130
+ .hbe-input-default {
131
+ overflow: hidden;
132
+ }
133
+
134
+ .hbe-input-field-default {
135
+ width: 100%;
136
+ background: transparent;
137
+ padding: 0.5em;
138
+ margin-bottom: 2em;
139
+ color: #f9f7f6;
140
+ z-index: 100;
141
+ opacity: 0;
142
+ }
143
+
144
+ .hbe-input-label-default {
145
+ width: 100%;
146
+ position: absolute;
147
+ text-align: left;
148
+ padding: 0.5em 0;
149
+ pointer-events: none;
150
+ font-size: 1em;
151
+ }
152
+
153
+ .hbe-input-label-default::before,
154
+ .hbe-input-label-default::after {
155
+ content: '';
156
+ position: absolute;
157
+ width: 100%;
158
+ left: 0;
159
+ }
160
+
161
+ .hbe-input-label-default::before {
162
+ height: 100%;
163
+ background: #666666;
164
+ top: 0;
165
+ -webkit-transform: translate3d(0, -100%, 0);
166
+ transform: translate3d(0, -100%, 0);
167
+ -webkit-transition: -webkit-transform 0.2s;
168
+ transition: transform 0.2s;
169
+ }
170
+
171
+ .hbe-input-label-default::after {
172
+ height: 2px;
173
+ background: #666666;
174
+ top: 100%;
175
+ -webkit-transition: opacity 0.2s;
176
+ transition: opacity 0.2s;
177
+ }
178
+
179
+ .hbe-input-label-content-default {
180
+ padding: 0;
181
+ -webkit-transform-origin: 0 0;
182
+ transform-origin: 0 0;
183
+ -webkit-transition: -webkit-transform 0.2s, color 0.2s;
184
+ transition: transform 0.2s, color 0.2s;
185
+ }
186
+
187
+ .hbe-input-field-default:focus,
188
+ .hbe-input--filled .hbe-input-field-default {
189
+ opacity: 1;
190
+ -webkit-transition: opacity 0s 0.2s;
191
+ transition: opacity 0s 0.2s;
192
+ }
193
+
194
+ .hbe-input-label-default::before,
195
+ .hbe-input-label-default::after,
196
+ .hbe-input-label-content-default,
197
+ .hbe-input-field-default:focus,
198
+ .hbe-input--filled .hbe-input-field-default {
199
+ -webkit-transition-timing-function: cubic-bezier(0, 0.25, 0.5, 1);
200
+ transition-timing-function: cubic-bezier(0, 0.25, 0.5, 1);
201
+ }
202
+
203
+ .hbe-input-field-default:focus + .hbe-input-label-default::before,
204
+ .hbe-input--filled .hbe-input-label-default::before {
205
+ -webkit-transform: translate3d(0, 0, 0);
206
+ transform: translate3d(0, 0, 0);
207
+ }
208
+
209
+ .hbe-input-field-default:focus + .hbe-input-label-default::after,
210
+ .hbe-input--filled .hbe-input-label-default::after {
211
+ opacity: 0;
212
+ }
213
+
214
+ .hbe-input-field-default:focus + .hbe-input-label-default .hbe-input-label-content-default,
215
+ .hbe-input--filled .hbe-input-label-default .hbe-input-label-content-default {
216
+ color: #555555;
217
+ -webkit-transform: translate3d(0, 2.1em, 0) scale3d(0.65, 0.65, 1);
218
+ transform: translate3d(0, 2.1em, 0) scale3d(0.65, 0.65, 1);
219
+ }
220
+ /* default theme }}} */