hexo-theme-shokax 0.4.0-alpha.1 → 0.4.0-alpha.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. package/_config.yml +5 -4
  2. package/languages/README.md +22 -0
  3. package/languages/ar.yml +153 -0
  4. package/languages/de.yml +153 -0
  5. package/languages/es.yml +153 -0
  6. package/languages/fr.yml +153 -0
  7. package/languages/hi.yml +153 -0
  8. package/languages/id.yml +153 -0
  9. package/languages/it.yml +153 -0
  10. package/languages/ko.yml +153 -0
  11. package/languages/nl.yml +153 -0
  12. package/languages/pl.yml +153 -0
  13. package/languages/pt.yml +153 -0
  14. package/languages/ru.yml +153 -0
  15. package/languages/tr.yml +153 -0
  16. package/languages/vi.yml +153 -0
  17. package/layout/_mixin/comment.pug +2 -37
  18. package/layout/_partials/footer.pug +1 -1
  19. package/layout/_partials/head/head.pug +7 -3
  20. package/layout/_partials/header.pug +1 -1
  21. package/layout/_partials/layout.pug +1 -10
  22. package/layout/_partials/post/footer.pug +0 -9
  23. package/package.json +8 -2
  24. package/scripts/generaters/archive.js +1 -1
  25. package/scripts/generaters/script.js +63 -39
  26. package/scripts/helpers/asset.js +3 -72
  27. package/scripts/helpers/list_categories.js +0 -4
  28. package/scripts/plugin/lib/injects.js +1 -1
  29. package/source/js/_app/components/comments.ts +60 -0
  30. package/source/js/_app/components/sidebar.ts +7 -5
  31. package/source/js/_app/components/tcomments.ts +41 -0
  32. package/source/js/_app/globals/globalVars.ts +1 -0
  33. package/source/js/_app/globals/handles.ts +6 -5
  34. package/source/js/_app/globals/themeColor.ts +1 -1
  35. package/source/js/_app/globals/thirdparty.ts +1 -1
  36. package/source/js/_app/globals/tools.ts +3 -2
  37. package/source/js/_app/library/anime.ts +6 -5
  38. package/source/js/_app/library/declare.d.ts +25 -9
  39. package/source/js/_app/library/loadFile.ts +3 -1
  40. package/source/js/_app/library/proto.ts +75 -77
  41. package/source/js/_app/library/vue.ts +38 -48
  42. package/source/js/_app/page/fancybox.ts +2 -1
  43. package/source/js/_app/page/post.ts +4 -3
  44. package/source/js/_app/page/search.ts +17 -11
  45. package/source/js/_app/page/tab.ts +3 -2
  46. package/source/js/_app/pjax/domInit.ts +5 -4
  47. package/source/js/_app/pjax/refresh.ts +20 -2
  48. package/source/js/_app/pjax/siteInit.ts +12 -7
  49. package/source/js/_app/player.ts +16 -15
  50. package/scripts/filters/locals.d.ts +0 -1
  51. package/scripts/filters/locals.ts +0 -59
  52. package/scripts/filters/post.d.ts +0 -0
  53. package/scripts/filters/post.ts +0 -6
  54. package/scripts/generaters/archive.d.ts +0 -1
  55. package/scripts/generaters/archive.ts +0 -144
  56. package/scripts/generaters/config.d.ts +0 -1
  57. package/scripts/generaters/config.ts +0 -52
  58. package/scripts/generaters/images.d.ts +0 -1
  59. package/scripts/generaters/images.ts +0 -26
  60. package/scripts/generaters/index.d.ts +0 -1
  61. package/scripts/generaters/index.ts +0 -110
  62. package/scripts/generaters/pages.d.ts +0 -0
  63. package/scripts/generaters/pages.ts +0 -16
  64. package/scripts/generaters/script.d.ts +0 -1
  65. package/scripts/generaters/script.ts +0 -110
  66. package/scripts/helpers/asset.d.ts +0 -1
  67. package/scripts/helpers/asset.ts +0 -158
  68. package/scripts/helpers/engine.d.ts +0 -1
  69. package/scripts/helpers/engine.ts +0 -171
  70. package/scripts/helpers/list_categories.d.ts +0 -1
  71. package/scripts/helpers/list_categories.ts +0 -104
  72. package/scripts/helpers/summary_ai.d.ts +0 -1
  73. package/scripts/helpers/summary_ai.ts +0 -100
  74. package/scripts/helpers/symbols_count_time.d.ts +0 -1
  75. package/scripts/helpers/symbols_count_time.ts +0 -76
  76. package/scripts/plugin/check.d.ts +0 -1
  77. package/scripts/plugin/check.ts +0 -35
  78. package/scripts/plugin/index.d.ts +0 -6
  79. package/scripts/plugin/index.ts +0 -52
  80. package/scripts/plugin/lib/injects-point.d.ts +0 -5
  81. package/scripts/plugin/lib/injects-point.ts +0 -20
  82. package/scripts/plugin/lib/injects.d.ts +0 -2
  83. package/scripts/plugin/lib/injects.ts +0 -101
  84. package/scripts/tags/links.d.ts +0 -1
  85. package/scripts/tags/links.ts +0 -75
  86. package/scripts/tags/media.d.ts +0 -1
  87. package/scripts/tags/media.ts +0 -19
  88. package/source/assets/beian.webp +0 -0
  89. package/source/js/_app/library/libtype.d.ts +0 -4
@@ -1 +0,0 @@
1
- export {};
@@ -1,75 +0,0 @@
1
- import fs from 'node:fs'
2
- import path from 'node:path'
3
- import yaml from 'js-yaml'
4
-
5
- /*
6
- {% links %}
7
- - site: #main title
8
- owner: #alternate title for image tooltip (nullable)
9
- url: #link of site
10
- desc: #description (nullable)
11
- image: #icon image (nullable)
12
- color: #block color (nullable)
13
- {% endlinks %}
14
-
15
- {% linksfile [path] %}
16
- */
17
-
18
- interface siteLink {
19
- site: string
20
- owner?: string
21
- url: string
22
- desc?: string
23
- image?: string
24
- color?: string
25
- }
26
-
27
- function linkGrid (args:string[], content:string) {
28
- const theme = hexo.theme.config as any
29
-
30
- if (!args[0] && !content) {
31
- return
32
- }
33
-
34
- if (args[0]) {
35
- const filepath = path.join(hexo.source_dir, args[0])
36
- if (fs.existsSync(filepath)) {
37
- content = fs.readFileSync(filepath, { encoding: 'utf-8' })
38
- }
39
- }
40
-
41
- if (!content) {
42
- return
43
- }
44
-
45
- const list = yaml.load(content) as Array<siteLink>
46
-
47
- let result = ''
48
-
49
- list.forEach((item) => {
50
- if (!item.url || !item.site) {
51
- return
52
- }
53
-
54
- let item_image = item.image || theme.assets + '/404.png'
55
-
56
- if (!item_image.startsWith('//') && !item_image.startsWith('http')) {
57
- item_image = theme.statics + item_image
58
- }
59
-
60
- item.color = item.color ? ` style="--block-color:${item.color};"` : ''
61
-
62
- result += `<div class="item" title="${item.owner || item.site}"${item.color}>`
63
-
64
- result += `<a href="${item.url}" class="image" data-background-image="${item_image}"></a>
65
- <div class="info">
66
- <a href="${item.url}" class="title">${item.site}</a>
67
- <p class="desc">${item.desc || item.url}</p>
68
- </div></div>`
69
- })
70
-
71
- return `<div class="links">${result}</div>`
72
- }
73
-
74
- hexo.extend.tag.register('links', linkGrid, { ends: true })
75
- hexo.extend.tag.register('linksfile', linkGrid, { ends: false, async: true })
@@ -1 +0,0 @@
1
- export {};
@@ -1,19 +0,0 @@
1
- 'use strict'
2
- /* global hexo */
3
- import yaml from 'js-yaml'
4
-
5
- function postMedia (args, content) {
6
- if (!args[0] || !content) {
7
- return
8
- }
9
- const list = yaml.load(content)
10
- switch (args[0]) {
11
- case 'video':
12
- case 'audio':
13
- return `<div class="media-container"><div class="player" data-type="${args[0]}" data-src='${JSON.stringify(list)}'></div></div>`
14
- }
15
- }
16
-
17
- hexo.extend.tag.register('media', postMedia, { ends: true })
18
-
19
- // return `<video src="${args}" preload="metadata" controls playsinline poster="">Sorry, your browser does not support the video tag.</video>`;
Binary file
@@ -1,4 +0,0 @@
1
- export {}
2
- declare global {
3
- const Vue: typeof import('vue')
4
- }