hexo-theme-stellar 1.8.0 → 1.9.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.
package/_config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  ######## Stellar info ########
2
2
  stellar:
3
- version: '1.8.0'
3
+ version: '1.9.0'
4
4
  homepage: 'https://xaoxuu.com/wiki/stellar/'
5
5
  repo: 'https://github.com/xaoxuu/hexo-theme-stellar'
6
6
  cdn_css: # Use cdn links instead of /css/main.css
@@ -65,8 +65,10 @@ breadcrumb:
65
65
 
66
66
  ######## Article ########
67
67
  article:
68
- # 如果没有指定封面,是否根据 tags 作为关键词搜索封面?
68
+ # 如果没有指定封面,是否根据 tags 作为关键词搜索封面图片?
69
69
  auto_cover: false # search from https://source.unsplash.com/
70
+ # 如果没有指定横幅,是否根据 tags 作为关键词搜索横幅图片?
71
+ auto_banner: false # search from https://source.unsplash.com/
70
72
  # 如果没有指定 excerpt 和 description,将自动取多长的内容作为文章摘要?
71
73
  auto_excerpt: 200
72
74
  # 分类颜色
@@ -84,7 +86,6 @@ article:
84
86
  auto_cover: true # 如果没有封面就根据 tags 作为关键词搜索封面,开了此项将不会自动从文章中提取首张图片作为封面了。
85
87
 
86
88
 
87
-
88
89
  ######## Comments ########
89
90
  comments:
90
91
  service: # beaudar, utterances, valine, twikoo, waline
@@ -109,6 +110,23 @@ comments:
109
110
  issue-number:
110
111
  theme: preferred-color-scheme
111
112
  label:
113
+ # giscus
114
+ # https://giscus.app/zh-CN
115
+ giscus:
116
+ data-repo: xxx/xxx # [在此输入仓库]
117
+ data-repo-id: # [在此输入仓库 ID]
118
+ data-category: # [在此输入分类名]
119
+ data-category-id:
120
+ data-mapping: pathname
121
+ data-strict: 0
122
+ data-reactions-enabled: 1
123
+ data-emit-metadata: 0
124
+ data-input-position: top # top, bottom
125
+ data-theme: preferred_color_scheme
126
+ data-lang: zh-CN
127
+ data-loading: lazy
128
+ crossorigin: anonymous
129
+
112
130
  valine:
113
131
  js: https://fastly.jsdelivr.net/gh/XuxuGood/simple-blog-cdn@main/js/Valine.min.js
114
132
  appId: # your appId
@@ -140,7 +158,7 @@ comments:
140
158
  js: https://unpkg.com/@waline/client@v2/dist/waline.js
141
159
  css: https://unpkg.com/@waline/client@v2/dist/waline.css
142
160
  # Waline server address url, you should set this to your own link
143
- serverURL:
161
+ serverURL:
144
162
 
145
163
  # If false, comment count will only be displayed in post page, not in home page
146
164
  commentCount: true
@@ -212,7 +230,7 @@ footer:
212
230
  # '更多':
213
231
  # - '[关于本站](/)'
214
232
  # - '[GitHub](/)'
215
- license: '[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)'
233
+ license: # '[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)'
216
234
  source: #'[GitHub](https://github.com/xaoxuu/hexo-theme-stellar)'
217
235
  more: # string or array (support markdown)
218
236
 
@@ -304,6 +322,22 @@ plugins:
304
322
  css: https://unpkg.com/heti/umd/heti.min.css
305
323
  js: https://unpkg.com/heti/umd/heti-addon.min.js
306
324
 
325
+ # MathJax
326
+ # 需在Markdown文件开头加入mathjax: true
327
+ # 推荐使用Pandoc: npm uninstall hexo-renderer-marked --save & npm install hexo-renderer-pandoc --save
328
+ mathjax:
329
+ enable: false
330
+ cdn: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.6/MathJax.js?config=TeX-AMS-MML_HTMLorMML
331
+
332
+ # Katex - The fastest math typesetting library for the web
333
+ # https://katex.org/docs/autorender.html
334
+ # https://github.com/KaTeX/KaTeX
335
+ # 使用 hexo-renderer-markdown-it-plus 作为公式渲染器:npm uninstall hexo-renderer-marked --save npm install hexo-renderer-markdown-it-plus --save
336
+ katex:
337
+ enable: false
338
+ min_css: <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/katex.min.css" integrity="sha384-Xi8rHCmBmhbuyyhbI88391ZKP2dmfnOl4rT9ZfRI7mLTdk1wblIUnrIq35nqwEvC" crossorigin="anonymous">
339
+ min_js: <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/katex.min.js" integrity="sha384-X/XCfMm41VSsqRNQgDerQczD69XqmjOOOwYQvr/uuC+j4OPoNhVgjdGFwhvN02Ja" crossorigin="anonymous"></script>
340
+ auto_render_min_js: <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/contrib/auto-render.min.js" integrity="sha384-+XBljXPPiv+OzfbB3cVmLHf4hdUFHlWNZN5spNQ7rmHTXpd7WvJum6fIACpNNfIR" crossorigin="anonymous"onload="renderMathInElement(document.body);"></script>
307
341
 
308
342
  style:
309
343
  darkmode: auto # auto / always / false
@@ -315,6 +349,7 @@ style:
315
349
  background: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.2/avatar/round/rainbow64@3x.webp
316
350
  codeblock:
317
351
  scrollbar: 4px
352
+ highlightjs_theme: https://fastly.jsdelivr.net/gh/highlightjs/cdn-release@11.5.0/build/styles/atom-one-dark.min.css
318
353
 
319
354
  default:
320
355
  avatar: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/avatar/round/3442075.svg
@@ -38,8 +38,8 @@ meta:
38
38
 
39
39
  footer:
40
40
  license: '本博客所有文章除特别声明外,均采用 %s 许可协议,转载请注明出处。'
41
- info_not_open_source: '本站由 %s 创建,使用 %s 作为主题。'
42
- info_open_source: '本站由 %s 创建,使用 %s 作为主题,您可以在 %s 找到本站源码。'
41
+ info_not_open_source: '本站由 %s 使用 %s 主题创建。'
42
+ info_open_source: '本站由 %s 使用 %s 主题创建,您可以在 %s 找到本站源码。'
43
43
 
44
44
  page:
45
45
  error:
@@ -38,8 +38,8 @@ meta:
38
38
 
39
39
  footer:
40
40
  license: '本網誌所有文章除特別聲明外,均採用 %s 授權條款。轉載請註明出處。'
41
- info_not_open_source: '本站由 %s 建立,使用 %s 作為主題。'
42
- info_open_source: '本站由 %s 建立,使用 %s 作為主題。您可以在 %s 找到本站原始碼。'
41
+ info_not_open_source: '本站由 %s 使用 %s 主題建立。'
42
+ info_open_source: '本站由 %s 使用 %s 主題建立。您可以在 %s 找到本站原始碼。'
43
43
 
44
44
  page:
45
45
  error:
@@ -1,15 +1,37 @@
1
1
  <%
2
2
  function div() {
3
3
  var el = '';
4
- if (page.banner == undefined || page.banner == false) {
4
+ if ((page.banner == undefined || page.banner == false) && !theme.article.auto_banner) {
5
5
  return el;
6
6
  }
7
+ var url;
8
+ if (page.banner != undefined) {
9
+ if (page.banner.includes('/')) {
10
+ url = page.banner;
11
+ } else {
12
+ url = 'https://source.unsplash.com/2000x400/?' + page.banner;
13
+ }
14
+ } else {
15
+ // 自动以 tags 作为关键词搜索封面
16
+ if (page.tags) {
17
+ var params = '';
18
+ page.tags.reverse().forEach((tag, i) => {
19
+ if (i > 0) {
20
+ params += ',';
21
+ }
22
+ params += tag.name;
23
+ });
24
+ url = 'https://source.unsplash.com/2000x400/?' + params;
25
+ } else {
26
+ url = 'https://source.unsplash.com/random/2000x400';
27
+ }
28
+ }
7
29
  el += '<div class="l_cover post' + scrollreveal() + '">';
8
30
  el += '<div class="cover">';
9
31
  if (theme.plugins.lazyload && theme.plugins.lazyload.enable) {
10
- el += '<div class="lazy img bg" data-bg="' + page.banner + '"></div>';
32
+ el += '<div class="lazy img bg" data-bg="' + url + '"></div>';
11
33
  } else {
12
- el += '<div class="lazy img bg" style="background-image:url(&quot;' + page.banner + '&quot;)"></div>';
34
+ el += '<div class="lazy img bg" style="background-image:url(&quot;' + url + '&quot;)"></div>';
13
35
  }
14
36
  el += '</div>';
15
37
  el += '</div>';
@@ -82,6 +82,17 @@ function og_args() {
82
82
  <%- favicon_tag(config.favicon) %>
83
83
  <% } %>
84
84
 
85
+ <% if (config.highlight && config.highlight.enable == true && config.highlight.hljs == true) { %>
86
+ <%- css(theme.style.codeblock.highlightjs_theme) %>
87
+ <% } %>
88
+
89
+ <% if (theme.plugins.katex && theme.plugins.katex.enable) { %>
90
+ <%- theme.plugins.katex.min_css %>
91
+ <%- theme.plugins.katex.min_js %>
92
+ <%- theme.plugins.katex.auto_render_min_js %>
93
+ <% } %>
94
+
95
+
85
96
  <% if (config.inject && config.inject.head){ %>
86
97
  <% (config.inject.head||[]).forEach(function(item){ %>
87
98
  <%- item %>
@@ -0,0 +1,39 @@
1
+ <%
2
+ function layoutDiv() {
3
+ const cmt = 'giscus';
4
+ // 合并配置参数
5
+ var config = Object.assign({}, theme.comments[cmt]);
6
+ if (page.layout === 'wiki' && page.wiki) {
7
+ let proj = theme.wiki.projects[page.wiki];
8
+ if (proj[cmt] != undefined) {
9
+ Object.assign(config, proj[cmt]);
10
+ }
11
+ }
12
+ Object.assign(config, page[cmt]);
13
+ // 合并评论数据
14
+ if (page.comment_id != undefined) {
15
+ config['data-mapping'] = 'specific';
16
+ config['data-term'] = page.comment_id;
17
+ } else if (page.layout === 'wiki' && page.wiki) {
18
+ let proj = theme.wiki.projects[page.wiki];
19
+ if (proj.comment_id != undefined) {
20
+ config['data-mapping'] = 'specific';
21
+ config['data-term'] = proj.comment_id;
22
+ }
23
+ }
24
+ // 布局
25
+ var el = '';
26
+ el += '<div id="' + cmt + '"';
27
+ for (let key of Object.keys(config)) {
28
+ if (config[key] !== null) {
29
+ el += ' ' + key + '="' + config[key] + '"';
30
+ }
31
+ }
32
+ el += '></div>';
33
+ return el;
34
+ }
35
+ %>
36
+
37
+ <svg class="loading" style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2709"><path d="M832 512c0-176-144-320-320-320V128c211.2 0 384 172.8 384 384h-64zM192 512c0 176 144 320 320 320v64C300.8 896 128 723.2 128 512h64z" p-id="2710"></path></svg>
38
+
39
+ <%- layoutDiv() %>
@@ -0,0 +1,26 @@
1
+ <script>
2
+ function loadJS() {
3
+ const els = document.querySelectorAll("#comments #giscus");
4
+ if (els.length === 0) return;
5
+ els.forEach((el, i) => {
6
+ try {
7
+ el.innerHTML = '';
8
+ } catch (error) {
9
+ console.log(error);
10
+ }
11
+ var script = document.createElement('script');
12
+ script.src = 'https://giscus.app/client.js';
13
+ script.async = true;
14
+ for (let key of Object.keys(el.attributes)) {
15
+ let attr = el.attributes[key];
16
+ if (['class', 'id'].includes(attr.name) === false) {
17
+ script.setAttribute(attr.name, attr.value);
18
+ }
19
+ }
20
+ el.appendChild(script);
21
+ });
22
+ }
23
+ window.addEventListener('DOMContentLoaded', (event) => {
24
+ loadJS();
25
+ });
26
+ </script>
@@ -9,7 +9,7 @@ if (theme.comments.service && theme.comments.service.length > 0) {
9
9
  if (loadComment && page.layout == 'wiki' && page.wiki) {
10
10
  let proj = theme.wiki.projects[page.wiki];
11
11
  if (proj.comment_title != undefined && page.comment_title == undefined) {
12
- if (['utterances', 'beaudar'].includes(theme.comments.service)) {
12
+ if (['utterances', 'beaudar', 'giscus'].includes(theme.comments.service)) {
13
13
  page.comment_title = proj.comment_title;
14
14
  }
15
15
  }
@@ -0,0 +1,29 @@
1
+ <% if (theme.plugins.mathjax.enable){ %>
2
+ <script type="text/x-mathjax-config">
3
+ MathJax.Hub.Config({
4
+ tex2jax: {
5
+ inlineMath: [ ['$','$'], ["\\(","\\)"] ],
6
+ processEscapes: true
7
+ }
8
+ });
9
+ </script>
10
+
11
+ <script type="text/x-mathjax-config">
12
+ MathJax.Hub.Config({
13
+ tex2jax: {
14
+ skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
15
+ }
16
+ });
17
+ </script>
18
+
19
+ <script type="text/x-mathjax-config">
20
+ MathJax.Hub.Queue(function() {
21
+ var all = MathJax.Hub.getAllJax(), i;
22
+ for(i=0; i < all.length; i += 1) {
23
+ all[i].SourceElement().parentNode.className += ' has-jax';
24
+ }
25
+ });
26
+ </script>
27
+
28
+ <script type="text/javascript" src="<%- theme.plugins.mathjax.cdn %>"></script>
29
+ <% } %>
package/layout/page.ejs CHANGED
@@ -10,7 +10,7 @@ function layoutTitle() {
10
10
  %>
11
11
  <% if (page.h1 || page.title || (page.content && page.content.length > 0)) { %>
12
12
  <%- partial('_partial/main/navbar/breadcrumb') %>
13
- <article class='content md <%- page.layout %><%- scrollreveal() %>'>
13
+ <article class='content md <%- page.layout %><%- page.indent ? ' indent' : '' %><%- scrollreveal() %>'>
14
14
  <%- layoutTitle() %>
15
15
  <% if (page.content && page.content.length > 0) { %>
16
16
  <%- page.content %>
package/layout/post.ejs CHANGED
@@ -19,6 +19,9 @@ if (theme.plugins.heti && theme.plugins.heti.enable) {
19
19
  heti = ' heti';
20
20
  }
21
21
  %>
22
+ <% if (page.mathjax == true){ %>
23
+ <%- partial('mathjax') %>
24
+ <% } %>
22
25
  <%- partial('_partial/main/navbar/breadcrumb') %>
23
26
  <article class='content<%- heti %> md <%- post.layout %><%- post.indent ? ' indent' : '' %><%- scrollreveal() %>'>
24
27
  <%- layoutTitle() %>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-stellar",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "Elegant and powerful theme for Hexo.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -6,3 +6,6 @@ const postTabs = require('./lib/tabs')(hexo);
6
6
  hexo.extend.tag.register('tabs', postTabs, true);
7
7
  hexo.extend.tag.register('subtabs', postTabs, true);
8
8
  hexo.extend.tag.register('subsubtabs', postTabs, true);
9
+
10
+ const users = require('./lib/users')(hexo);
11
+ hexo.extend.tag.register('users', users);
@@ -0,0 +1,23 @@
1
+ /**
2
+ * users.js v1 | https://github.com/xaoxuu/hexo-theme-stellar/
3
+ * 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
4
+ *
5
+ * {% users api:https://api.github.com/repos/xaoxuu/hexo-theme-stellar/contributors %}
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ module.exports = ctx => function(args) {
11
+ args = ctx.args.map(args, ['api']);
12
+ var el = '<div class="tag-plugin users-wrap">';
13
+
14
+ el += '<div class="friendsjs-wrap"';
15
+ el += ' id="friends-api"';
16
+ el += ' api="' + args.api + '"';
17
+ el += '>';
18
+ el += '<div class="group-body"></div>';
19
+ el += '</div>';
20
+
21
+ el += '</div>';
22
+ return el;
23
+ };
@@ -12,6 +12,15 @@ a
12
12
  &:hover
13
13
  color: $color-hover
14
14
 
15
+ // md > a
16
+ p, li
17
+ >a:not([class])
18
+ margin: 0 1px
19
+ padding: 4px
20
+ border-radius: 4px
21
+ &:hover
22
+ color: darken($color-hover, 10)
23
+ background: alpha($color-hover, 0.08)
15
24
 
16
25
  hr
17
26
  color: var(--text-meta)
@@ -1,6 +1,7 @@
1
1
  .cap
2
2
  font-weight: 500
3
3
  font-size: $fs-12
4
+ scrollbar-width: none
4
5
  color: var(--text-p3)
5
6
  &.blue
6
7
  color: darken($color-md-blue, 6)
@@ -78,6 +78,17 @@ article.md .highlight
78
78
  table:not([class])
79
79
  border-collapse: collapse
80
80
 
81
+
82
+ article.md pre
83
+ >.caption
84
+ color: var(--text-p3)
85
+ >.hljs
86
+ padding: 1rem
87
+ border-radius: $border-block
88
+ border: 1px solid var(--block-border)
89
+ line-height: 1.5
90
+ box-sizing: border-box
91
+
81
92
  article.md .highlight
82
93
  .code
83
94
  vertical-align: top
@@ -133,7 +144,7 @@ article.md .highlight
133
144
  content: "Python"
134
145
  &.php .code:before
135
146
  content: "PHP"
136
- &.rust .code:before
147
+ &.rust .code:before,&.rs .code:before
137
148
  content: "Rust"
138
149
  &.sql .code:before
139
150
  content: "SQL"
@@ -143,8 +154,8 @@ article.md .highlight
143
154
  content: "Makefile"
144
155
  &.go .code:before
145
156
  content: "Go"
146
- &.typescript .code:before
147
- content: "TypeScript"
157
+ &.typescript .code:before,&.ts .code:before
158
+ content: "TS"
148
159
 
149
160
 
150
161
 
@@ -1,7 +1,7 @@
1
1
  .l_main
2
2
  position: relative
3
3
  padding-bottom: "calc(1 * %s)" % var(--gap-l)
4
- @media screen and (min-width: 1280px)
4
+ @media screen and (min-width: 1400px)
5
5
  margin-left: "calc(2 * %s)" % var(--gap-l)
6
6
  margin-right: "calc(2 * %s + %s)" % (var(--gap-l) var(--width-left))
7
7
  @media screen and (min-width: $device-tablet)
@@ -91,21 +91,13 @@ article.md.content
91
91
  h1+h2
92
92
  margin-top: -0.5rem
93
93
  h2+h3
94
- margin-top: -1rem
94
+ margin-top: -0.5rem
95
95
  h3+h4
96
- margin-top: -1rem
96
+ margin-top: -0.5rem
97
97
  h4+h5
98
- margin-top: -1rem
98
+ margin-top: -0.5rem
99
99
  h5+h6
100
- margin-top: -1rem
101
-
102
- // a
103
- article.md
104
- p, li:not([class])
105
- >a:not([class])
106
- font-weight: 500
107
- &:hover
108
- text-decoration: underline
100
+ margin-top: -0.5rem
109
101
 
110
102
  article.md p
111
103
  font-size: $fs-p
@@ -23,8 +23,6 @@
23
23
  ul
24
24
  margin: 0
25
25
  overflow: hidden
26
- a:hover
27
- text-decoration: underline
28
26
  .post-title
29
27
  margin: 0.5rem 0
30
28
  line-height: 1.2
@@ -9,6 +9,7 @@
9
9
  .page-footer .sitemap
10
10
  margin: .5rem 0 2rem
11
11
  display: grid
12
+ scrollbar-width: none
12
13
  grid-gap: 1rem 1rem
13
14
  grid-auto-flow: column dense
14
15
  overflow: scroll
@@ -36,3 +37,8 @@
36
37
  line-height: 1.2
37
38
  a
38
39
  text-decoration: underline
40
+ font-weight: 500
41
+ margin: inherit
42
+ padding: inherit
43
+ &:hover
44
+ background: inherit
@@ -42,6 +42,7 @@
42
42
  width: 40vw
43
43
  max-width: 460px
44
44
  border: 1px solid var(--block-hover)
45
+ z-index: 1
45
46
  .img
46
47
  min-width: 100%
47
48
  min-height: 140px
@@ -149,6 +149,7 @@ nav.menu
149
149
  .l_left .widgets
150
150
  overflow: scroll
151
151
  flex-grow: 1
152
+ scrollbar-width: none
152
153
  scrollbar(0, 0)
153
154
  z-index: 1
154
155
  .widget-wrap
@@ -188,8 +189,6 @@ nav.menu
188
189
  margin-top: .5em
189
190
  margin-bottom: .5em
190
191
  line-height: 1.5
191
- >a:hover
192
- text-decoration: underline
193
192
  .widget-header+.widget-body
194
193
  margin-top: 0
195
194
 
@@ -42,6 +42,8 @@ details.folding[open]
42
42
  &:after
43
43
  content: '-'
44
44
  >div.body
45
+ display: flex;
46
+ flex-direction: column;
45
47
  padding: 1rem
46
48
  margin: 0 - 1rem
47
49
  margin-top: 0
@@ -1,3 +1,6 @@
1
1
  .cmt-body.utterances
2
2
  margin: 0 -4px
3
3
  width: 'calc(100% + %s)' % 8px
4
+
5
+ .related-wrap#comments div.cmt-body svg.loading
6
+ top: 62px
@@ -0,0 +1,61 @@
1
+ .cmt-body.waline
2
+ --waline-font-size: 0.9375rem;
3
+ /* 常规颜色 */
4
+ --waline-white: #fff;
5
+ --waline-light-grey: #999;
6
+ --waline-dark-grey: #666;
7
+ /* 主题色 */
8
+ --waline-theme-color: #3498db;
9
+ --waline-active-color: #2ecc71;
10
+ /* 布局颜色 */
11
+ --waline-color: #444;
12
+ --waline-bgcolor: #fff;
13
+ --waline-bgcolor-light: #f8f8f8;
14
+ --waline-bgcolor-hover: #f0f0f0;
15
+ --waline-border-color: #ddd;
16
+ --waline-disable-bgcolor: #f8f8f8;
17
+ --waline-disable-color: #bbb;
18
+ --waline-code-bgcolor: #282c34;
19
+ /* 特殊颜色 */
20
+ --waline-bq-color: #f0f0f0;
21
+ /* 头像 */
22
+ --waline-avatar-size: 3.25rem;
23
+ --waline-m-avatar-size: calc(var(--waline-avatar-size) * 9 / 13);
24
+ /* 徽章 */
25
+ --waline-badge-color: #3498db;
26
+ --waline-badge-font-size: 0.725em;
27
+ /* 信息 */
28
+ --waline-info-bgcolor: #f8f8f8;
29
+ --waline-info-color: #999;
30
+ --waline-info-font-size: 0.725em;
31
+ /* 渲染选择 */
32
+ --waline-border: 1px solid var(--waline-border-color);
33
+ --waline-avatar-radius: 50%;
34
+ --waline-box-shadow: none;
35
+
36
+
37
+ @media (prefers-color-scheme: dark)
38
+ --waline-white: #000;
39
+ --waline-light-grey: #666;
40
+ --waline-dark-grey: #999;
41
+ /* 布局颜色 */
42
+
43
+ --waline-color: #fff;
44
+ --waline-bgcolor: var(--block);
45
+ --waline-bgcolor-light: #272727;
46
+ --waline-border-color: #333;
47
+ --waline-disable-bgcolor: #444;
48
+ --waline-disable-color: #272727;
49
+ /* 特殊颜色 */
50
+ --waline-bq-color: #272727;
51
+ /* 其他颜色 */
52
+ --waline-info-bgcolor: #272727;
53
+ --waline-info-color: #666;
54
+
55
+ .wl-count
56
+ @media (prefers-color-scheme: dark)
57
+ padding: .375em;
58
+ font-weight: bold;
59
+ font-size: 1.25em;
60
+ color: #fff;
61
+
@@ -17,3 +17,5 @@ if hexo-config('comments.service') == 'utterances'
17
17
  @import 'comments/utterances'
18
18
  if hexo-config('comments.service') == 'valine'
19
19
  @import 'comments/valine'
20
+ if hexo-config('comments.service') == 'waline'
21
+ @import 'comments/waline'
@@ -47,13 +47,14 @@ const friendsjs = {
47
47
  $(el).append('<div class="loading-wrap"><svg class="loading" style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2709"><path d="M832 512c0-176-144-320-320-320V128c211.2 0 384 172.8 384 384h-64zM192 512c0 176 144 320 320 320v64C300.8 896 128 723.2 128 512h64z" p-id="2710"></path></svg><p></p></div>');
48
48
  friendsjs.requestAPI(cfg.api, function(data) {
49
49
  $(el).find('.loading-wrap').remove();
50
- const arr = data.content;
50
+ const arr = data.content || data;
51
+ console.log(data);
51
52
  arr.forEach((item, i) => {
52
53
  var user = '<div class="user-card">';
53
54
  user += '<a class="card-link" target="_blank" rel="external nofollow noopener noreferrer"';
54
- user += ' href="' + item.url + '">';
55
- user += '<img src="' + (item.avatar || cfg.avatar) + '" onerror="javascript:this.src=\'' + cfg.avatar + '\';">';
56
- user += '<div class="name"><span>' + item.title + '</span></div>';
55
+ user += ' href="' + (item.html_url || item.url) + '">';
56
+ user += '<img src="' + (item.avatar_url || item.avatar || cfg.avatar) + '" onerror="javascript:this.src=\'' + cfg.avatar + '\';">';
57
+ user += '<div class="name"><span>' + (item.title || item.login) + '</span></div>';
57
58
  user += '</a>';
58
59
  user += '</div>';
59
60
  $(el).find('.group-body').append(user);