hexo-theme-stellar 1.19.0 → 1.21.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 (89) hide show
  1. package/README.md +3 -3
  2. package/_config.yml +49 -22
  3. package/languages/zh-CN.yml +1 -1
  4. package/languages/zh-TW.yml +1 -1
  5. package/layout/404.ejs +1 -1
  6. package/layout/_partial/cover/wiki_cover.ejs +10 -16
  7. package/layout/_partial/head.ejs +3 -3
  8. package/layout/_partial/main/article/article_footer.ejs +86 -54
  9. package/layout/_partial/main/article/read_next.ejs +17 -12
  10. package/layout/_partial/main/navbar/breadcrumb.ejs +55 -17
  11. package/layout/_partial/main/navbar/list_post.ejs +6 -4
  12. package/layout/_partial/main/navbar/list_wiki.ejs +4 -3
  13. package/layout/_partial/main/post_list/post_card.ejs +1 -1
  14. package/layout/_partial/main/post_list/wiki_card.ejs +6 -11
  15. package/layout/_partial/{main/article/ai_abstract.ejs → plugins/ai/tianli_gpt.ejs} +3 -2
  16. package/layout/_partial/plugins/comments/beaudar/script.ejs +1 -1
  17. package/layout/_partial/plugins/comments/giscus/script.ejs +1 -1
  18. package/layout/_partial/plugins/comments/layout.ejs +2 -2
  19. package/layout/_partial/plugins/comments/utterances/script.ejs +1 -1
  20. package/layout/_partial/sidebar/header.ejs +1 -1
  21. package/layout/_partial/sidebar/index.ejs +4 -4
  22. package/layout/_partial/widgets/ghissues.ejs +1 -1
  23. package/layout/_partial/widgets/ghrepo.ejs +1 -1
  24. package/layout/_partial/widgets/ghuser.ejs +1 -1
  25. package/layout/_partial/widgets/recent.ejs +3 -3
  26. package/layout/_partial/widgets/related.ejs +13 -21
  27. package/layout/_partial/widgets/toc.ejs +20 -12
  28. package/layout/index.ejs +13 -11
  29. package/layout/mermaid.ejs +8 -4
  30. package/layout/page.ejs +3 -0
  31. package/layout/post.ejs +1 -1
  32. package/layout/wiki.ejs +4 -1
  33. package/package.json +1 -1
  34. package/scripts/events/lib/doc_tree.js +142 -97
  35. package/scripts/filters/index.js +4 -1
  36. package/scripts/helpers/category_color.js +18 -5
  37. package/scripts/tags/index.js +5 -3
  38. package/scripts/tags/inline-labels.js +2 -2
  39. package/scripts/tags/lib/banner.js +68 -0
  40. package/scripts/tags/lib/{ablock.js → box.js} +4 -4
  41. package/scripts/tags/lib/checkbox.js +1 -1
  42. package/scripts/tags/lib/folders.js +1 -1
  43. package/scripts/tags/lib/folding.js +1 -1
  44. package/scripts/tags/lib/gallery.js +51 -0
  45. package/scripts/tags/lib/hashtag.js +36 -0
  46. package/scripts/tags/lib/image.js +5 -1
  47. package/scripts/tags/lib/mark.js +1 -1
  48. package/scripts/tags/lib/navbar.js +15 -34
  49. package/scripts/tags/lib/note.js +1 -1
  50. package/scripts/tags/lib/okr.js +140 -0
  51. package/scripts/tags/lib/swiper.js +1 -1
  52. package/scripts/tags/lib/timeline.js +3 -3
  53. package/scripts/tags/lib/toc.js +1 -1
  54. package/source/css/_common/highlight.styl +3 -0
  55. package/source/css/_custom.styl +2 -2
  56. package/source/css/_defines/theme.styl +0 -1
  57. package/source/css/_layout/list.styl +12 -4
  58. package/source/css/_layout/md.styl +11 -8
  59. package/source/css/_layout/partial/bread-nav.styl +32 -0
  60. package/source/css/_layout/partial/cover.styl +2 -0
  61. package/source/css/_layout/partial/paginator.styl +9 -5
  62. package/source/css/_layout/tag-plugins/banner.styl +106 -0
  63. package/source/css/_layout/tag-plugins/common.styl +33 -39
  64. package/source/css/_layout/tag-plugins/folding.styl +1 -1
  65. package/source/css/_layout/tag-plugins/frame.styl +1 -1
  66. package/source/css/_layout/tag-plugins/gallery.styl +46 -0
  67. package/source/css/_layout/tag-plugins/grid.styl +0 -9
  68. package/source/css/_layout/tag-plugins/hashtag.styl +17 -0
  69. package/source/css/_layout/tag-plugins/mark.styl +2 -5
  70. package/source/css/_layout/tag-plugins/note.styl +2 -1
  71. package/source/css/_layout/tag-plugins/okr.styl +106 -0
  72. package/source/css/_layout/tag-plugins/timeline.styl +14 -1
  73. package/source/css/_layout/widgets/ghuser.styl +5 -6
  74. package/source/css/_plugins/copycode.styl +17 -6
  75. package/source/css/_plugins/fancybox.styl +4 -0
  76. package/source/css/_plugins/index.styl +2 -0
  77. package/source/css/_plugins/mermaid.styl +125 -10
  78. package/source/css/{_layout/partial/ai_abstract.styl → _plugins/tianli_gpt.styl} +2 -2
  79. package/source/js/main.js +25 -3
  80. package/source/js/plugins/copycode.js +1 -7
  81. package/source/js/plugins/fcircle.js +3 -3
  82. package/source/js/plugins/friends.js +3 -3
  83. package/source/js/plugins/linkcard.js +1 -1
  84. package/source/js/plugins/memos.js +133 -0
  85. package/source/js/plugins/sites.js +4 -4
  86. package/source/js/plugins/timeline.js +3 -3
  87. package/source/js/plugins/weibo.js +3 -3
  88. package/scripts/tags/lib/tag.js +0 -35
  89. package/source/css/_layout/tag-plugins/tag.styl +0 -13
@@ -1,12 +1,8 @@
1
1
  const codeElementArr = document.querySelectorAll('.code')
2
2
  codeElementArr.forEach(code => {
3
- const codeBeforeWidth = window.getComputedStyle(code, '::before').width.split('px')[0]
4
- const codeBeforePadding = window.getComputedStyle(code, '::before').padding.split(' ').pop().split('px')[0]
5
-
6
3
  // copy btn
7
4
  const codeCopyBtn = document.createElement('div')
8
5
  codeCopyBtn.classList.add('copy-btn')
9
- codeCopyBtn.style.right = Number(codeBeforeWidth) + Number(codeBeforePadding) * 2 + 'px'
10
6
  codeCopyBtn.innerText = stellar.plugins.copycode.default_text
11
7
 
12
8
  code.appendChild(codeCopyBtn)
@@ -26,12 +22,10 @@ codeElementArr.forEach(code => {
26
22
  })
27
23
 
28
24
  async function copyCode(currentCode) {
29
- // console.log(currentCode)
30
- // console.log('复制代码')
31
25
  if (navigator.clipboard) {
32
26
  try {
33
27
  await navigator.clipboard.writeText(currentCode)
34
- } catch (error) {
28
+ } catch (error) {
35
29
  // 未获得用户许可
36
30
  codeCopyBtn.innerText = '未获得用户许可'
37
31
  codeCopyBtn.classList.add('warning')
@@ -44,7 +44,7 @@ const FCircle = {
44
44
  },
45
45
  layoutDiv: (cfg) => {
46
46
  const el = $(cfg.el)[0];
47
- $(el).append('<div class="loading-wrap"><svg xmlns="http://www.w3.org/2000/svg" width="2rem" height="2rem" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" stroke-opacity=".3" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.3s" values="60;0"/></path><path stroke-dasharray="15" stroke-dashoffset="15" d="M12 3C16.9706 3 21 7.02944 21 12"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></g></svg></div>');
47
+ $(el).append('<div class="loading-wrap"><svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" stroke-opacity=".3" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.3s" values="60;0"/></path><path stroke-dasharray="15" stroke-dashoffset="15" d="M12 3C16.9706 3 21 7.02944 21 12"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></g></svg></div>');
48
48
  FCircle.requestAPI(cfg.api, function(data) {
49
49
  $(el).find('.loading-wrap').remove();
50
50
  const arr = data.article_data || [];
@@ -69,7 +69,7 @@ const FCircle = {
69
69
  });
70
70
  }, function() {
71
71
  $(el).find('.loading-wrap svg').remove();
72
- $(el).find('.loading-wrap').append('<svg xmlns="http://www.w3.org/2000/svg" width="2rem" height="2rem" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" d="M12 3L21 20H3L12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.5s" values="60;0"/></path><path stroke-dasharray="6" stroke-dashoffset="6" d="M12 10V14"><animate fill="freeze" attributeName="stroke-dashoffset" begin="0.6s" dur="0.2s" values="6;0"/></path></g><circle cx="12" cy="17" r="1" fill="currentColor" fill-opacity="0"><animate fill="freeze" attributeName="fill-opacity" begin="0.8s" dur="0.4s" values="0;1"/></circle></svg>');
72
+ $(el).find('.loading-wrap').append('<svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" d="M12 3L21 20H3L12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.5s" values="60;0"/></path><path stroke-dasharray="6" stroke-dashoffset="6" d="M12 10V14"><animate fill="freeze" attributeName="stroke-dashoffset" begin="0.6s" dur="0.2s" values="6;0"/></path></g><circle cx="12" cy="17" r="1" fill="currentColor" fill-opacity="0"><animate fill="freeze" attributeName="fill-opacity" begin="0.8s" dur="0.4s" values="0;1"/></circle></svg>');
73
73
  $(el).find('.loading-wrap').addClass('error');
74
74
  });
75
75
  },
@@ -86,7 +86,7 @@ $(function () {
86
86
  var cfg = new Object();
87
87
  cfg.el = el;
88
88
  cfg.api = api;
89
- cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.4/avatar/round/3442075.svg';
89
+ cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.9/avatar/round/3442075.svg';
90
90
  FCircle.layoutDiv(cfg);
91
91
  }
92
92
  });
@@ -44,7 +44,7 @@ const friendsjs = {
44
44
  },
45
45
  layout: (cfg) => {
46
46
  const el = $(cfg.el)[0];
47
- $(el).append('<div class="loading-wrap"><svg xmlns="http://www.w3.org/2000/svg" width="2rem" height="2rem" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" stroke-opacity=".3" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.3s" values="60;0"/></path><path stroke-dasharray="15" stroke-dashoffset="15" d="M12 3C16.9706 3 21 7.02944 21 12"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></g></svg></div>');
47
+ $(el).append('<div class="loading-wrap"><svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" stroke-opacity=".3" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.3s" values="60;0"/></path><path stroke-dasharray="15" stroke-dashoffset="15" d="M12 3C16.9706 3 21 7.02944 21 12"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></g></svg></div>');
48
48
  friendsjs.requestAPI(cfg.api, function(data) {
49
49
  $(el).find('.loading-wrap').remove();
50
50
  const arr = data.content || data;
@@ -60,7 +60,7 @@ const friendsjs = {
60
60
  });
61
61
  }, function() {
62
62
  $(el).find('.loading-wrap svg').remove();
63
- $(el).find('.loading-wrap').append('<svg xmlns="http://www.w3.org/2000/svg" width="2rem" height="2rem" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" d="M12 3L21 20H3L12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.5s" values="60;0"/></path><path stroke-dasharray="6" stroke-dashoffset="6" d="M12 10V14"><animate fill="freeze" attributeName="stroke-dashoffset" begin="0.6s" dur="0.2s" values="6;0"/></path></g><circle cx="12" cy="17" r="1" fill="currentColor" fill-opacity="0"><animate fill="freeze" attributeName="fill-opacity" begin="0.8s" dur="0.4s" values="0;1"/></circle></svg>');
63
+ $(el).find('.loading-wrap').append('<svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" d="M12 3L21 20H3L12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.5s" values="60;0"/></path><path stroke-dasharray="6" stroke-dashoffset="6" d="M12 10V14"><animate fill="freeze" attributeName="stroke-dashoffset" begin="0.6s" dur="0.2s" values="6;0"/></path></g><circle cx="12" cy="17" r="1" fill="currentColor" fill-opacity="0"><animate fill="freeze" attributeName="fill-opacity" begin="0.8s" dur="0.4s" values="0;1"/></circle></svg>');
64
64
  $(el).find('.loading-wrap').addClass('error');
65
65
  });
66
66
  },
@@ -78,7 +78,7 @@ $(function () {
78
78
  cfg.el = el;
79
79
  cfg.api = api;
80
80
  cfg.class = el.getAttribute('class');
81
- cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.4/avatar/round/3442075.svg';
81
+ cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.9/avatar/round/3442075.svg';
82
82
  friendsjs.layout(cfg);
83
83
  }
84
84
  });
@@ -42,7 +42,7 @@ function setCardLink(nodes) {
42
42
  }).then(function(data) {
43
43
  renderer(el, data);
44
44
  }).catch(function(error) {
45
- console.log(error);
45
+ console.error(error);
46
46
  });
47
47
  })
48
48
  }
@@ -0,0 +1,133 @@
1
+ const MemosJS = {
2
+ requestAPI: (url, callback, timeout) => {
3
+ let retryTimes = 5;
4
+ function request() {
5
+ return new Promise((resolve, reject) => {
6
+ let status = 0; // 0 等待 1 完成 2 超时
7
+ let timer = setTimeout(() => {
8
+ if (status === 0) {
9
+ status = 2;
10
+ timer = null;
11
+ reject('请求超时');
12
+ if (retryTimes == 0) {
13
+ timeout();
14
+ }
15
+ }
16
+ }, 5000);
17
+ fetch(url).then(function(response) {
18
+ if (status !== 2) {
19
+ clearTimeout(timer);
20
+ resolve(response);
21
+ timer = null;
22
+ status = 1;
23
+ }
24
+ if (response.ok) {
25
+ return response.json();
26
+ }
27
+ throw new Error('Network response was not ok.');
28
+ }).then(function(data) {
29
+ retryTimes = 0;
30
+ callback(data);
31
+ }).catch(function(error) {
32
+ if (retryTimes > 0) {
33
+ retryTimes -= 1;
34
+ setTimeout(() => {
35
+ request();
36
+ }, 5000);
37
+ } else {
38
+ timeout();
39
+ }
40
+ });
41
+ });
42
+ }
43
+ request();
44
+ },
45
+ layoutDiv: (cfg) => {
46
+ const el = $(cfg.el)[0];
47
+ $(el).append('<div class="loading-wrap"><svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" stroke-opacity=".3" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.3s" values="60;0"/></path><path stroke-dasharray="15" stroke-dashoffset="15" d="M12 3C16.9706 3 21 7.02944 21 12"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></g></svg></div>');
48
+ MemosJS.requestAPI(cfg.api, function(data) {
49
+ $(el).find('.loading-wrap').remove();
50
+ var users = [];
51
+ const filter = el.getAttribute('user');
52
+ if (filter && filter.length > 0) {
53
+ users = filter.split(",");
54
+ }
55
+ var hide = [];
56
+ const hideStr = el.getAttribute('hide');
57
+ if (hideStr && hideStr.length > 0) {
58
+ hide = hideStr.split(",");
59
+ }
60
+ data.forEach((item, i) => {
61
+ if (cfg.limit && i >= cfg.limit) {
62
+ return;
63
+ }
64
+ if (item.user && item.user.login && users.length > 0) {
65
+ if (!users.includes(item.user.login)) {
66
+ return;
67
+ }
68
+ }
69
+ let date = new Date(item.createdTs * 1000)
70
+ var cell = '<div class="timenode" index="' + i + '">';
71
+ cell += '<div class="header">';
72
+ if (!users.length && !hide.includes('user')) {
73
+ cell += '<div class="user-info">';
74
+ if (cfg.avatar?.length > 0) {
75
+ cell += `<img src="${cfg.avatar}">`;
76
+ }
77
+ cell += '<span>' + item.creatorName + '</span>';
78
+ cell += '</div>';
79
+ }
80
+ cell += '<p>' + date.toLocaleString() + '</p>';
81
+ cell += '</div>';
82
+ cell += '<div class="body">';
83
+ cell += marked.parse(item.content || '');
84
+ var imgs = [];
85
+ for (let res of item.resourceList) {
86
+ if (res.type?.includes('image/')) {
87
+ imgs.push(res);
88
+ }
89
+ }
90
+ if (imgs.length > 0) {
91
+ cell += '<div class="tag-plugin image">';
92
+ for (let img of imgs) {
93
+ if (img.externalLink?.length > 0) {
94
+ cell += `<div class="image-bg"><img src="${img.externalLink}" fancybox="true"></div>`;
95
+ } else {
96
+ cell += `<div class="image-bg"><img src="https://${cfg.host}/o/r/${img.id}" fancybox="true"></div>`;
97
+ }
98
+
99
+ }
100
+ cell += '</div>';
101
+ }
102
+ cell += '</div>';
103
+ cell += '</div>';
104
+ $(el).append(cell);
105
+ });
106
+ }, function() {
107
+ $(el).find('.loading-wrap svg').remove();
108
+ $(el).find('.loading-wrap').append('<svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" d="M12 3L21 20H3L12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.5s" values="60;0"/></path><path stroke-dasharray="6" stroke-dashoffset="6" d="M12 10V14"><animate fill="freeze" attributeName="stroke-dashoffset" begin="0.6s" dur="0.2s" values="6;0"/></path></g><circle cx="12" cy="17" r="1" fill="currentColor" fill-opacity="0"><animate fill="freeze" attributeName="fill-opacity" begin="0.8s" dur="0.4s" values="0;1"/></circle></svg>');
109
+ $(el).find('.loading-wrap').addClass('error');
110
+ });
111
+ },
112
+ }
113
+
114
+ $(function () {
115
+ const els = document.getElementsByClassName('stellar-memos-api');
116
+ for (var i = 0; i < els.length; i++) {
117
+ const el = els[i];
118
+ const api = el.getAttribute('api');
119
+ if (api == null) {
120
+ continue;
121
+ }
122
+ var cfg = new Object();
123
+ cfg.el = el;
124
+ cfg.api = api;
125
+ cfg.limit = el.getAttribute('limit');
126
+ cfg.host = api.replace(/https:\/\/(.*?)\/(.*)/i, '$1');
127
+ cfg.avatar = el.getAttribute('avatar');
128
+ if (!cfg.avatar) {
129
+ cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.9/avatar/round/3442075.svg';
130
+ }
131
+ MemosJS.layoutDiv(cfg);
132
+ }
133
+ });
@@ -44,7 +44,7 @@ const sitesjs = {
44
44
  },
45
45
  layout: (cfg) => {
46
46
  const el = $(cfg.el)[0];
47
- $(el).append('<div class="loading-wrap"><svg xmlns="http://www.w3.org/2000/svg" width="2rem" height="2rem" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" stroke-opacity=".3" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.3s" values="60;0"/></path><path stroke-dasharray="15" stroke-dashoffset="15" d="M12 3C16.9706 3 21 7.02944 21 12"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></g></svg></div>');
47
+ $(el).append('<div class="loading-wrap"><svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" stroke-opacity=".3" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.3s" values="60;0"/></path><path stroke-dasharray="15" stroke-dashoffset="15" d="M12 3C16.9706 3 21 7.02944 21 12"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></g></svg></div>');
48
48
  sitesjs.requestAPI(cfg.api, function(data) {
49
49
  $(el).find('.loading-wrap').remove();
50
50
  const arr = data.content;
@@ -63,7 +63,7 @@ const sitesjs = {
63
63
  });
64
64
  }, function() {
65
65
  $(el).find('.loading-wrap svg').remove();
66
- $(el).find('.loading-wrap').append('<svg xmlns="http://www.w3.org/2000/svg" width="2rem" height="2rem" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" d="M12 3L21 20H3L12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.5s" values="60;0"/></path><path stroke-dasharray="6" stroke-dashoffset="6" d="M12 10V14"><animate fill="freeze" attributeName="stroke-dashoffset" begin="0.6s" dur="0.2s" values="6;0"/></path></g><circle cx="12" cy="17" r="1" fill="currentColor" fill-opacity="0"><animate fill="freeze" attributeName="fill-opacity" begin="0.8s" dur="0.4s" values="0;1"/></circle></svg>');
66
+ $(el).find('.loading-wrap').append('<svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" d="M12 3L21 20H3L12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.5s" values="60;0"/></path><path stroke-dasharray="6" stroke-dashoffset="6" d="M12 10V14"><animate fill="freeze" attributeName="stroke-dashoffset" begin="0.6s" dur="0.2s" values="6;0"/></path></g><circle cx="12" cy="17" r="1" fill="currentColor" fill-opacity="0"><animate fill="freeze" attributeName="fill-opacity" begin="0.8s" dur="0.4s" values="0;1"/></circle></svg>');
67
67
  $(el).find('.loading-wrap').addClass('error');
68
68
  });
69
69
  },
@@ -81,8 +81,8 @@ $(function () {
81
81
  cfg.class = el.getAttribute('class');
82
82
  cfg.el = el;
83
83
  cfg.api = api;
84
- cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.4/link/8f277b4ee0ecd.svg';
85
- cfg.screenshot = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.4/cover/76b86c0226ffd.svg';
84
+ cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.9/link/8f277b4ee0ecd.svg';
85
+ cfg.screenshot = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.9/cover/76b86c0226ffd.svg';
86
86
  sitesjs.layout(cfg);
87
87
  }
88
88
  });
@@ -54,7 +54,7 @@ const StellarTimeline = {
54
54
  },
55
55
  layoutDiv: (cfg) => {
56
56
  const el = $(cfg.el)[0];
57
- $(el).append('<div class="loading-wrap"><svg xmlns="http://www.w3.org/2000/svg" width="2rem" height="2rem" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" stroke-opacity=".3" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.3s" values="60;0"/></path><path stroke-dasharray="15" stroke-dashoffset="15" d="M12 3C16.9706 3 21 7.02944 21 12"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></g></svg></div>');
57
+ $(el).append('<div class="loading-wrap"><svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" stroke-opacity=".3" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.3s" values="60;0"/></path><path stroke-dasharray="15" stroke-dashoffset="15" d="M12 3C16.9706 3 21 7.02944 21 12"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></g></svg></div>');
58
58
  StellarTimeline.requestAPI(cfg.api, function(data) {
59
59
  $(el).find('.loading-wrap').remove();
60
60
  const query = new URL(cfg.api).search;
@@ -84,7 +84,7 @@ const StellarTimeline = {
84
84
  cell += '</a>';
85
85
  }
86
86
  let date = new Date(item.created_at);
87
- cell += '<p>' + date.toString().replace(/\sGMT([^.]*)/i, "") + '</p>';
87
+ cell += '<p>' + date.toLocaleString() + '</p>';
88
88
  cell += '</div>';
89
89
  cell += '<div class="body">';
90
90
  if (!hide.includes('title')) {
@@ -140,7 +140,7 @@ const StellarTimeline = {
140
140
  });
141
141
  }, function() {
142
142
  $(el).find('.loading-wrap svg').remove();
143
- $(el).find('.loading-wrap').append('<svg xmlns="http://www.w3.org/2000/svg" width="2rem" height="2rem" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" d="M12 3L21 20H3L12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.5s" values="60;0"/></path><path stroke-dasharray="6" stroke-dashoffset="6" d="M12 10V14"><animate fill="freeze" attributeName="stroke-dashoffset" begin="0.6s" dur="0.2s" values="6;0"/></path></g><circle cx="12" cy="17" r="1" fill="currentColor" fill-opacity="0"><animate fill="freeze" attributeName="fill-opacity" begin="0.8s" dur="0.4s" values="0;1"/></circle></svg>');
143
+ $(el).find('.loading-wrap').append('<svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" d="M12 3L21 20H3L12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.5s" values="60;0"/></path><path stroke-dasharray="6" stroke-dashoffset="6" d="M12 10V14"><animate fill="freeze" attributeName="stroke-dashoffset" begin="0.6s" dur="0.2s" values="6;0"/></path></g><circle cx="12" cy="17" r="1" fill="currentColor" fill-opacity="0"><animate fill="freeze" attributeName="fill-opacity" begin="0.8s" dur="0.4s" values="0;1"/></circle></svg>');
144
144
  $(el).find('.loading-wrap').addClass('error');
145
145
  });
146
146
  },
@@ -44,7 +44,7 @@ const weibojs = {
44
44
  },
45
45
  layoutDiv: (cfg) => {
46
46
  const el = $(cfg.el)[0];
47
- $(el).append('<div class="loading-wrap"><svg xmlns="http://www.w3.org/2000/svg" width="2rem" height="2rem" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" stroke-opacity=".3" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.3s" values="60;0"/></path><path stroke-dasharray="15" stroke-dashoffset="15" d="M12 3C16.9706 3 21 7.02944 21 12"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></g></svg></div>');
47
+ $(el).append('<div class="loading-wrap"><svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" stroke-opacity=".3" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.3s" values="60;0"/></path><path stroke-dasharray="15" stroke-dashoffset="15" d="M12 3C16.9706 3 21 7.02944 21 12"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></g></svg></div>');
48
48
  weibojs.requestAPI(cfg.api, function(data) {
49
49
  $(el).find('.loading-wrap').remove();
50
50
  const arr = data.tweets || [];
@@ -93,7 +93,7 @@ const weibojs = {
93
93
  });
94
94
  }, function() {
95
95
  $(el).find('.loading-wrap svg').remove();
96
- $(el).find('.loading-wrap').append('<svg xmlns="http://www.w3.org/2000/svg" width="2rem" height="2rem" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" d="M12 3L21 20H3L12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.5s" values="60;0"/></path><path stroke-dasharray="6" stroke-dashoffset="6" d="M12 10V14"><animate fill="freeze" attributeName="stroke-dashoffset" begin="0.6s" dur="0.2s" values="6;0"/></path></g><circle cx="12" cy="17" r="1" fill="currentColor" fill-opacity="0"><animate fill="freeze" attributeName="fill-opacity" begin="0.8s" dur="0.4s" values="0;1"/></circle></svg>');
96
+ $(el).find('.loading-wrap').append('<svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" d="M12 3L21 20H3L12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.5s" values="60;0"/></path><path stroke-dasharray="6" stroke-dashoffset="6" d="M12 10V14"><animate fill="freeze" attributeName="stroke-dashoffset" begin="0.6s" dur="0.2s" values="6;0"/></path></g><circle cx="12" cy="17" r="1" fill="currentColor" fill-opacity="0"><animate fill="freeze" attributeName="fill-opacity" begin="0.8s" dur="0.4s" values="0;1"/></circle></svg>');
97
97
  $(el).find('.loading-wrap').addClass('error');
98
98
  });
99
99
  },
@@ -110,7 +110,7 @@ $(function () {
110
110
  var cfg = new Object();
111
111
  cfg.el = el;
112
112
  cfg.api = api;
113
- cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.4/avatar/round/3442075.svg';
113
+ cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.9/avatar/round/3442075.svg';
114
114
  weibojs.layoutDiv(cfg);
115
115
  }
116
116
  });
@@ -1,35 +0,0 @@
1
- /**
2
- * tag.js v1.0 | https://github.com/xaoxuu/hexo-theme-stellar/
3
- * 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
4
- *
5
- * {% tag text href [color:color] %}
6
- *
7
- */
8
-
9
- 'use strict'
10
-
11
- const tag_colors = ['red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple']
12
- var tag_index = 0
13
-
14
- module.exports = ctx => function(args) {
15
- args = ctx.args.map(args, ['color'], ['text', 'href'])
16
- if (args.color == null) {
17
- const default_color = ctx.theme.config.tag_plugins.tag?.default_color
18
- if (default_color) {
19
- args.color = default_color
20
- } else {
21
- args.color = tag_colors[tag_index]
22
- tag_index += 1
23
- if (tag_index >= tag_colors.length) {
24
- tag_index = 0
25
- }
26
- }
27
- }
28
- var el = ''
29
- el += '<a class="tag-plugin tag"'
30
- el += ' ' + ctx.args.joinTags(args, ['color', 'href']).join(' ')
31
- el += '>'
32
- el += args.text
33
- el += '</a>'
34
- return el
35
- }
@@ -1,13 +0,0 @@
1
- .md-text .tag-plugin.tag
2
- padding: 0px 4px
3
- border-radius: 2px
4
- background: var(--theme-bg1)
5
- color: var(--text-p2)
6
- margin: 2px 0
7
- display: inline-block
8
- font-size: $fs-14
9
- trans2 background color
10
- &:hover
11
- background: var(--text-p2)
12
- color: var(--theme-bg1)
13
-