hexo-theme-solitude 1.2.2 → 1.2.4
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 +26 -3
- package/layout/category.pug +10 -13
- package/layout/includes/inject/body.pug +2 -3
- package/layout/includes/inject/head.pug +7 -3
- package/layout/includes/widgets/aside/asideTag.pug +1 -1
- package/layout/includes/widgets/home/postList.pug +20 -21
- package/layout/includes/widgets/third-party/comments/comment.pug +3 -1
- package/layout/includes/widgets/third-party/comments/waline.pug +17 -0
- package/layout/index.pug +2 -1
- package/layout/tag.pug +13 -16
- package/package.json +1 -1
- package/scripts/filter/default.js +27 -21
- package/source/css/_global/index.styl +1 -45
- package/source/css/_global/var.styl +10 -1
- package/source/css/_layout/index.styl +1 -0
- package/source/css/_mode/index.styl +49 -5
- package/source/css/_widgets/comment/waline.styl +75 -0
- package/source/css/index.styl +3 -2
- package/source/js/extend/{console/comment.js → comment/twikoo.js} +0 -1
- package/source/js/main.js +28 -4
- /package/source/css/{_comment → _widgets/comment}/index.styl +0 -0
- /package/source/css/{_comment → _widgets/comment}/twikoo.styl +0 -0
package/_config.yml
CHANGED
@@ -259,12 +259,14 @@ page:
|
|
259
259
|
tags: true # 标签页
|
260
260
|
categories: true # 分类页
|
261
261
|
default: # 默认值
|
262
|
-
cover:
|
262
|
+
cover:
|
263
|
+
- /img/default.png # 默认图片
|
263
264
|
|
264
265
|
# 文章页默认设置
|
265
266
|
post:
|
266
267
|
default:
|
267
|
-
cover:
|
268
|
+
cover:
|
269
|
+
- /img/default.png # 默认图片
|
268
270
|
locate: 衡阳
|
269
271
|
copyright:
|
270
272
|
enable: true
|
@@ -334,6 +336,19 @@ loading:
|
|
334
336
|
fullpage: false # 全局加载动画
|
335
337
|
pace: false # 顶部加载动画
|
336
338
|
|
339
|
+
# 用于自定义的主题颜色
|
340
|
+
# 注意:颜色值必须使用引号,如“#000”,否则可能会导致错误!
|
341
|
+
# --------------------------------------
|
342
|
+
theme_color:
|
343
|
+
dark: "#f2b94b" # 暗色模式
|
344
|
+
dark_op: '#f2b94b23' # 暗色模式透明
|
345
|
+
dark_op_deep: '#f2b94b4d' # 暗色模式透明深色
|
346
|
+
dark_none: '#f2b94b00' # 暗色模式透明无色
|
347
|
+
light: "#bdbdf0" # 亮色模式
|
348
|
+
light_op: '#4259ef23' # 亮色模式透明
|
349
|
+
light_op_deep: '#eccec5' # 亮色模式透明深色
|
350
|
+
light_none: '#4259ef01' # 亮色模式透明无色
|
351
|
+
|
337
352
|
# 第三方设置
|
338
353
|
thirdparty:
|
339
354
|
wordcount: false # 字数统计
|
@@ -392,12 +407,18 @@ thirdparty:
|
|
392
407
|
# 评论
|
393
408
|
comment:
|
394
409
|
enable: false # 是否开启评论
|
395
|
-
type:
|
410
|
+
type: # valine, twikoo
|
411
|
+
lazyload: false # 是否开启懒加载
|
412
|
+
count: false # 是否显示评论数
|
396
413
|
# 评论系统
|
397
414
|
twikoo:
|
398
415
|
envId: # url: https://twikoo.sondy.top/
|
399
416
|
lang: 'zh-CN' # 语言
|
400
417
|
accessToken: # accessToken
|
418
|
+
waline:
|
419
|
+
envId: # url: https://waline.js.org/
|
420
|
+
pageview: false # 是否开启页面访问量统计
|
421
|
+
option: # waline配置项
|
401
422
|
|
402
423
|
# 插入代码到头部 </head> 之前 和 底部 </body> 之前
|
403
424
|
# 插入额外代码 如:统计,广告等
|
@@ -487,6 +508,8 @@ cdn:
|
|
487
508
|
pacejs: https://cdn.bootcdn.net/ajax/libs/pace/1.2.4/pace.min.js
|
488
509
|
echartsjs: https://cdn.bootcdn.net/ajax/libs/echarts/5.4.2/echarts.min.js
|
489
510
|
lunrjs: https://cdn.bootcdn.net/ajax/libs/lunr.js/2.3.9/lunr.min.js
|
511
|
+
walinecss: https://cdn.bootcdn.net/ajax/libs/waline/2.15.7/waline.min.css
|
512
|
+
walinejs: https://cdn.bootcdn.net/ajax/libs/waline/2.15.7/waline.min.js
|
490
513
|
body:
|
491
514
|
viewimagejs: /lib/view-image.min.js
|
492
515
|
waterfalljs: /lib/waterfall.min.js
|
package/layout/category.pug
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
extends includes/layout.pug
|
2
2
|
|
3
3
|
block content
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
include includes/widgets/home/postList
|
15
|
-
include includes/mixins/pagination
|
16
|
-
include includes/widgets/aside/aside
|
4
|
+
main.layout#content-inner
|
5
|
+
div#category
|
6
|
+
div#category-bar
|
7
|
+
div.category-bar-items#category-bar-items
|
8
|
+
include includes/widgets/home/categoryBar
|
9
|
+
div.recent-posts#recent-posts
|
10
|
+
each post in site.posts.find({ parent: { $exists: false } }).data
|
11
|
+
include includes/widgets/home/postList
|
12
|
+
include includes/mixins/pagination
|
13
|
+
include includes/widgets/aside/aside
|
@@ -54,9 +54,8 @@ if theme.aside.welcome.enable
|
|
54
54
|
script(src='/js/txmap.js')
|
55
55
|
|
56
56
|
if theme.comment.enable
|
57
|
-
script(src='/js/extend/console/comment.js')
|
58
|
-
|
59
57
|
if theme.comment.type === 'twikoo'
|
58
|
+
script(src='/js/extend/comment/twikoo.js')
|
60
59
|
script(src='/js/commentBarrage.js')
|
61
60
|
|
62
61
|
// pjax
|
@@ -65,4 +64,4 @@ include ../widgets/third-party/pjax.pug
|
|
65
64
|
// inject custom body
|
66
65
|
if theme.extends.body
|
67
66
|
each item in theme.extends.body
|
68
|
-
|
67
|
+
!= item
|
@@ -18,8 +18,12 @@ link(rel="stylesheet", href=cdn.snackbarcss)
|
|
18
18
|
|
19
19
|
// comment
|
20
20
|
if theme.comment.enable
|
21
|
-
|
22
|
-
|
21
|
+
case theme.comment.type
|
22
|
+
when 'twikoo'
|
23
|
+
script(src=cdn.twikoojs)
|
24
|
+
when 'waline'
|
25
|
+
script(src=cdn.walinejs)
|
26
|
+
link(rel="stylesheet", href=cdn.walinecss)
|
23
27
|
|
24
28
|
// search
|
25
29
|
if theme.thirdparty.search.enable
|
@@ -40,7 +44,7 @@ if theme.says.home_mini || theme.aside.history.enable
|
|
40
44
|
// custom inject
|
41
45
|
if theme.extends.head
|
42
46
|
each item in theme.extends.head
|
43
|
-
item
|
47
|
+
!= item
|
44
48
|
|
45
49
|
// post-ai
|
46
50
|
if theme.thirdparty.ai.enable
|
@@ -1,26 +1,25 @@
|
|
1
|
-
|
2
|
-
div
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
div.recent-post-info
|
7
|
-
div.recent-post-info-top
|
8
|
-
|
9
|
-
|
10
|
-
span(class="original")= category.name
|
1
|
+
div(class="recent-post-item" onclick="pjax.loadUrl('/" + post.path + "')")
|
2
|
+
div.post_cover.left_radius
|
3
|
+
a(href=url_for(post.path), title=post.title)
|
4
|
+
img(src=url_for(post.cover), alt=post.title, class="post_bg")
|
5
|
+
div.recent-post-info
|
6
|
+
div.recent-post-info-top
|
7
|
+
div.recent-post-info-top-tips
|
8
|
+
each category in post.categories.data
|
9
|
+
span(class="original")= category.name
|
11
10
|
|
12
|
-
|
13
|
-
|
11
|
+
if post.prev == null && is_home()
|
12
|
+
span(class="original")="最新"
|
14
13
|
|
15
|
-
|
14
|
+
a(class="unvisited-post" href=url_for(post.path), data-pjax-state)= "未读"
|
16
15
|
|
17
|
-
|
16
|
+
a(class="article-title" href=url_for(post.path), data-pjax-state, title=post.title)= post.title
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
div.article-meta-wrap
|
19
|
+
span.article-meta.tags
|
20
|
+
each tag in post.tags.data
|
21
|
+
a(class="article-meta__tags" href=url_for(tag.path), data-pjax-state, onclick="window.event.cancelable=true")
|
22
|
+
span.tags-punctuation=tag.name
|
24
23
|
|
25
|
-
|
26
|
-
|
24
|
+
span.post-meta-date
|
25
|
+
time(datetime=moment(post.date))
|
@@ -0,0 +1,17 @@
|
|
1
|
+
- const { envId, option, pageview } = theme.comment.waline
|
2
|
+
- const { lazyload, count, type } = theme.comment
|
3
|
+
|
4
|
+
script.
|
5
|
+
async function initComment() {
|
6
|
+
(() => {
|
7
|
+
const waline = Waline.init(Object.assign({
|
8
|
+
el: '#comment',
|
9
|
+
serverURL: '!{envId}',
|
10
|
+
pageview: !{lazyload ? false : pageview},
|
11
|
+
dark: 'html[data-theme="dark"]',
|
12
|
+
path: window.location.pathname,
|
13
|
+
search: false,
|
14
|
+
comment: !{lazyload ? false : count},
|
15
|
+
}, !{JSON.stringify(option)}))
|
16
|
+
})()
|
17
|
+
}
|
package/layout/index.pug
CHANGED
@@ -11,7 +11,8 @@ block content
|
|
11
11
|
div#category-bar
|
12
12
|
include ./includes/widgets/home/categoryBar.pug
|
13
13
|
|
14
|
-
|
14
|
+
for post in page.posts.sort('-date').data
|
15
|
+
include ./includes/widgets/home/postList.pug
|
15
16
|
|
16
17
|
// pageination
|
17
18
|
include ./includes/mixins/pagination.pug
|
package/layout/tag.pug
CHANGED
@@ -1,19 +1,16 @@
|
|
1
1
|
extends includes/layout.pug
|
2
2
|
|
3
3
|
block content
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
include includes/widgets/home/postList
|
18
|
-
include includes/mixins/pagination
|
19
|
-
include includes/widgets/aside/aside
|
4
|
+
main.layout#content-inner
|
5
|
+
div#tag
|
6
|
+
div#tag-page-tags
|
7
|
+
each tag in site.tags.find({ parent: { $exists: false } }).data
|
8
|
+
a(id=tag.name class=(tag.name === page.tag ? 'select' : '') href=url_for(tag.path))
|
9
|
+
span.tags-punctuation
|
10
|
+
| #{tag.name}
|
11
|
+
span.tagsPageCount #{tag.length}
|
12
|
+
div.recent-posts#recent-posts
|
13
|
+
each post in site.posts.find({ parent: { $exists: false } }).data
|
14
|
+
include includes/widgets/home/postList
|
15
|
+
include includes/mixins/pagination
|
16
|
+
include includes/widgets/aside/aside
|
package/package.json
CHANGED
@@ -1,23 +1,29 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
hexo.extend.filter.register('after_post_render', function(data){
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
});
|
3
|
+
hexo.extend.filter.register('after_post_render', function (data) {
|
4
|
+
const config = hexo.theme.config
|
5
|
+
data.title = data.title || '无标题';
|
6
|
+
if (data.layout === 'post') {
|
7
|
+
data.locate = data.locate || config.post.default.locate
|
8
|
+
data.cc = data.cc || config.post.default.copyright
|
9
|
+
data.cover = data.cover || config.post.default.cover[getRandomInt(0, config.post.default.cover.length)]
|
10
|
+
data.excerpt = data.description || data.excerpt
|
11
|
+
if (config.aside.toc.post && data.toc !== false) data.toc = true
|
12
|
+
else data.toc = false
|
13
|
+
}
|
14
|
+
if (data.layout === 'page') {
|
15
|
+
data.cover = data.cover || config.page.default.cover[getRandomInt(0, config.post.default.cover.length)]
|
16
|
+
data.excerpt = data.title
|
17
|
+
if (config.aside.toc.page && data.toc !== false && data.aside) data.toc = true
|
18
|
+
else data.toc = false
|
19
|
+
}
|
20
|
+
if (config.comment.enable && data.comment !== false) data.comment = true
|
21
|
+
else data.comment = false
|
22
|
+
return data;
|
23
|
+
});
|
24
|
+
|
25
|
+
function getRandomInt(min, max) {
|
26
|
+
min = Math.ceil(min);
|
27
|
+
max = Math.floor(max);
|
28
|
+
return Math.floor(Math.random() * (max - min)) + min;
|
29
|
+
}
|
@@ -73,48 +73,4 @@
|
|
73
73
|
|
74
74
|
+maxWidth768()
|
75
75
|
--style-border 0px solid var(--sco-none) !important
|
76
|
-
--style-border-hover 0px solid var(--sco-main) !important
|
77
|
-
|
78
|
-
[data-theme=light]
|
79
|
-
--sco-theme #bdbdf0
|
80
|
-
--sco-theme-op #4259ef23
|
81
|
-
--sco-theme-op-deep #eccec5
|
82
|
-
--sco-theme-op-light #4259ef0d
|
83
|
-
--sco-theme-none #4259ef01
|
84
|
-
--sco-blue #425aef
|
85
|
-
--sco-red #f04a63
|
86
|
-
--sco-pink #ff7c7c
|
87
|
-
--sco-green #57bd6a
|
88
|
-
--sco-yellow #c28b00
|
89
|
-
--sco-yellow-op #d99c001a
|
90
|
-
--sco-orange #e38100
|
91
|
-
--sco-purple #7a60d2
|
92
|
-
--sco-fontcolor #363636
|
93
|
-
--sco-background #f7f9fe
|
94
|
-
--sco-reverse #000
|
95
|
-
--sco-maskbg rgba(255, 255, 255, 0.6)
|
96
|
-
--sco-maskbgdeep rgba(255, 255, 255, 0.85)
|
97
|
-
--sco-hovertext var(--sco-main)
|
98
|
-
--sco-ahoverbg #f7f7fa
|
99
|
-
--sco-lighttext var(--sco-main)
|
100
|
-
--sco-secondtext rgba(60, 60, 67, 0.8)
|
101
|
-
--sco-scrollbar rgba(60, 60, 67, 0.4)
|
102
|
-
--sco-card-btn-bg #edf0f7
|
103
|
-
--sco-post-blockquote-bg #fafcff
|
104
|
-
--sco-post-tabs-bg #f2f5f8
|
105
|
-
--sco-secondbg #f7f7f9
|
106
|
-
--sco-shadow-nav 0 5px 12px -5px rgba(102, 68, 68, 0.05)
|
107
|
-
--sco-card-bg #fff
|
108
|
-
--sco-card-bg-op var(--sco-black-op)
|
109
|
-
--sco-card-bg-none rgba(255, 255, 255, 0)
|
110
|
-
--sco-shadow-lightblack 0 5px 12px -5px rgba(102, 68, 68, 0.00)
|
111
|
-
--sco-shadow-light2black 0 5px 12px -5px rgba(102, 68, 68, 0.00)
|
112
|
-
--sco-card-border #e3e8f7
|
113
|
-
--sco-shadow-border 0 8px 16px -4px #2c2d300c
|
114
|
-
--style-border 1px solid var(--sco-card-border)
|
115
|
-
--style-border-always 1px solid var(--sco-card-border)
|
116
|
-
--style-border-hover 1px solid var(--sco-main)
|
117
|
-
--style-border-hover-always 1px solid var(--sco-main)
|
118
|
-
--style-border-dashed 1px dashed var(--sco-theme-op)
|
119
|
-
--style-border-forever 2px solid var(--sco-main)
|
120
|
-
--sco-navbg var(--sco-theme-op)
|
76
|
+
--style-border-hover 0px solid var(--sco-main) !important
|
@@ -1 +1,10 @@
|
|
1
|
-
error_img = hexo-config('errorpage.img')
|
1
|
+
error_img = hexo-config('errorpage.img')
|
2
|
+
|
3
|
+
$dark_theme = convert(hexo-config('theme_color.dark'))
|
4
|
+
$dark_theme_op = convert(hexo-config('theme_color.dark_op'))
|
5
|
+
$dark_theme_op_deep = convert(hexo-config('theme_color.dark_op_deep'))
|
6
|
+
$dark_theme_none = hexo-config('theme_color.dark_none')
|
7
|
+
$light_theme = convert(hexo-config('theme_color.light'))
|
8
|
+
$light_theme_op = convert(hexo-config('theme_color.light_op'))
|
9
|
+
$light_theme_op_deep = convert(hexo-config('theme_color.light_op_deep'))
|
10
|
+
$light_theme_none = hexo-config('theme_color.light_none')
|
@@ -1,8 +1,8 @@
|
|
1
1
|
[data-theme=dark]
|
2
|
-
--sco-theme
|
3
|
-
--sco-theme-op
|
4
|
-
--sco-theme-op-deep
|
5
|
-
--sco-theme-none
|
2
|
+
--sco-theme $dark_theme
|
3
|
+
--sco-theme-op $dark_theme_op
|
4
|
+
--sco-theme-op-deep $dark_theme_op_deep
|
5
|
+
--sco-theme-none $dark_theme_none
|
6
6
|
--sco-blue #0084ff
|
7
7
|
--sco-red #ff3842
|
8
8
|
--sco-pink #d44040
|
@@ -49,4 +49,48 @@
|
|
49
49
|
a
|
50
50
|
&.darkmode_switchbutton
|
51
51
|
background var(--sco-orange) !important
|
52
|
-
color var(--sco-white) !important
|
52
|
+
color var(--sco-white) !important
|
53
|
+
|
54
|
+
[data-theme=light]
|
55
|
+
--sco-theme $light_theme
|
56
|
+
--sco-theme-op $light_theme_op
|
57
|
+
--sco-theme-op-deep $light_theme_op_deep
|
58
|
+
--sco-theme-op-light #4259ef0d
|
59
|
+
--sco-theme-none $light_theme_none
|
60
|
+
--sco-blue #425aef
|
61
|
+
--sco-red #f04a63
|
62
|
+
--sco-pink #ff7c7c
|
63
|
+
--sco-green #57bd6a
|
64
|
+
--sco-yellow #c28b00
|
65
|
+
--sco-yellow-op #d99c001a
|
66
|
+
--sco-orange #e38100
|
67
|
+
--sco-purple #7a60d2
|
68
|
+
--sco-fontcolor #363636
|
69
|
+
--sco-background #f7f9fe
|
70
|
+
--sco-reverse #000
|
71
|
+
--sco-maskbg rgba(255, 255, 255, 0.6)
|
72
|
+
--sco-maskbgdeep rgba(255, 255, 255, 0.85)
|
73
|
+
--sco-hovertext var(--sco-main)
|
74
|
+
--sco-ahoverbg #f7f7fa
|
75
|
+
--sco-lighttext var(--sco-main)
|
76
|
+
--sco-secondtext rgba(60, 60, 67, 0.8)
|
77
|
+
--sco-scrollbar rgba(60, 60, 67, 0.4)
|
78
|
+
--sco-card-btn-bg #edf0f7
|
79
|
+
--sco-post-blockquote-bg #fafcff
|
80
|
+
--sco-post-tabs-bg #f2f5f8
|
81
|
+
--sco-secondbg #f7f7f9
|
82
|
+
--sco-shadow-nav 0 5px 12px -5px rgba(102, 68, 68, 0.05)
|
83
|
+
--sco-card-bg #fff
|
84
|
+
--sco-card-bg-op var(--sco-black-op)
|
85
|
+
--sco-card-bg-none rgba(255, 255, 255, 0)
|
86
|
+
--sco-shadow-lightblack 0 5px 12px -5px rgba(102, 68, 68, 0.00)
|
87
|
+
--sco-shadow-light2black 0 5px 12px -5px rgba(102, 68, 68, 0.00)
|
88
|
+
--sco-card-border #e3e8f7
|
89
|
+
--sco-shadow-border 0 8px 16px -4px #2c2d300c
|
90
|
+
--style-border 1px solid var(--sco-card-border)
|
91
|
+
--style-border-always 1px solid var(--sco-card-border)
|
92
|
+
--style-border-hover 1px solid var(--sco-main)
|
93
|
+
--style-border-hover-always 1px solid var(--sco-main)
|
94
|
+
--style-border-dashed 1px dashed var(--sco-theme-op)
|
95
|
+
--style-border-forever 2px solid var(--sco-main)
|
96
|
+
--sco-navbg var(--sco-theme-op)
|
@@ -0,0 +1,75 @@
|
|
1
|
+
#comment
|
2
|
+
.wl-sort li
|
3
|
+
color var(--sco-gray)
|
4
|
+
|
5
|
+
&.active
|
6
|
+
color var(--sco-main) !important
|
7
|
+
|
8
|
+
.wl-comment
|
9
|
+
.wl-panel
|
10
|
+
margin 0 !important
|
11
|
+
|
12
|
+
.wl-footer
|
13
|
+
.wl-info
|
14
|
+
button
|
15
|
+
background-color var(--sco-card-bg)
|
16
|
+
border var(--style-border-always)
|
17
|
+
color var(--sco-fontcolor)
|
18
|
+
|
19
|
+
button:hover
|
20
|
+
background-color var(--sco-main)
|
21
|
+
border-color var(--sco-main)
|
22
|
+
color var(--sco-card-bg)
|
23
|
+
|
24
|
+
#wl-edit
|
25
|
+
font-size 13px
|
26
|
+
line-height 1.5
|
27
|
+
margin .75rem .25rem
|
28
|
+
|
29
|
+
.wl-action
|
30
|
+
transition .3s
|
31
|
+
|
32
|
+
&:hover
|
33
|
+
color var(--sco-main)
|
34
|
+
|
35
|
+
.wl-meta-head
|
36
|
+
.wl-count
|
37
|
+
color var(--sco-gray)
|
38
|
+
font-size 14px
|
39
|
+
font-weight normal
|
40
|
+
|
41
|
+
.wl-cards
|
42
|
+
font-size 16px!important
|
43
|
+
.wl-comment-actions
|
44
|
+
button
|
45
|
+
margin-right 15px
|
46
|
+
font-size 18px
|
47
|
+
|
48
|
+
&:hover
|
49
|
+
color var(--sco-main)
|
50
|
+
.wl-head .wl-nick
|
51
|
+
font-size 20px !important
|
52
|
+
color var(--sco-lighttext)
|
53
|
+
font-weight bolder
|
54
|
+
|
55
|
+
.wl-meta>span
|
56
|
+
background var(--sco-gray)
|
57
|
+
border-radius 5px
|
58
|
+
color var(--sco-card-bg)
|
59
|
+
margin-right 5px
|
60
|
+
|
61
|
+
.wl-user
|
62
|
+
img
|
63
|
+
flex-shrink 0
|
64
|
+
height 2.5rem
|
65
|
+
width 2.5rem
|
66
|
+
overflow hidden
|
67
|
+
text-align center
|
68
|
+
border-radius 2.5rem
|
69
|
+
border 2px solid var(--sco-white)
|
70
|
+
|
71
|
+
[data-waline] a
|
72
|
+
color var(--sco-main) !important
|
73
|
+
|
74
|
+
.wl-content pre, .wl-content pre[class*=language-]
|
75
|
+
padding .5rem!important
|
package/source/css/index.styl
CHANGED
@@ -15,8 +15,9 @@ if hexo-config('css_prefix')
|
|
15
15
|
|
16
16
|
// comment
|
17
17
|
if hexo-config('comment.enable')
|
18
|
-
@import '
|
19
|
-
@import '
|
18
|
+
@import '_widgets/comment/index.styl'
|
19
|
+
@import '_widgets/comment/twikoo.styl' when hexo-config('comment.type') == 'twikoo'
|
20
|
+
@import '_widgets/comment/waline.styl' when hexo-config('comment.type') == 'waline'
|
20
21
|
|
21
22
|
// commentBarrage
|
22
23
|
if hexo-config('thirdparty.comment.enable')
|
package/source/js/main.js
CHANGED
@@ -846,7 +846,7 @@ let sco = {
|
|
846
846
|
|
847
847
|
pageText.addEventListener("keydown", (event) => {
|
848
848
|
if (event.keyCode === 13) {
|
849
|
-
|
849
|
+
sco.toPage();
|
850
850
|
pjax.loadUrl(pageButton.href);
|
851
851
|
}
|
852
852
|
});
|
@@ -881,7 +881,29 @@ let sco = {
|
|
881
881
|
cookiesWindow.style.display = 'none';
|
882
882
|
}
|
883
883
|
}
|
884
|
-
}
|
884
|
+
},
|
885
|
+
/**
|
886
|
+
* 首页分页跳转
|
887
|
+
*/
|
888
|
+
toPage: function () {
|
889
|
+
const pageNumbers = document.querySelectorAll(".page-number");
|
890
|
+
const maxPageNumber = parseInt(pageNumbers[pageNumbers.length - 1].innerHTML);
|
891
|
+
const inputElement = document.getElementById("toPageText");
|
892
|
+
const inputPageNumber = parseInt(inputElement.value);
|
893
|
+
|
894
|
+
if (!isNaN(inputPageNumber) && inputPageNumber > 0 && inputPageNumber <= maxPageNumber) {
|
895
|
+
const currentPageUrl = window.location.href.replace(/\/page\/\d+\/$/, "/");
|
896
|
+
let targetPageUrl;
|
897
|
+
|
898
|
+
if (inputPageNumber === 1) {
|
899
|
+
targetPageUrl = currentPageUrl;
|
900
|
+
} else {
|
901
|
+
targetPageUrl = currentPageUrl + (currentPageUrl.endsWith("/") ? "" : "/") + "page/" + inputPageNumber + "/";
|
902
|
+
}
|
903
|
+
|
904
|
+
document.getElementById("toPageButton").href = targetPageUrl;
|
905
|
+
}
|
906
|
+
},
|
885
907
|
}
|
886
908
|
|
887
909
|
/*
|
@@ -1005,7 +1027,6 @@ window.refreshFn = () => {
|
|
1005
1027
|
GLOBAL_CONFIG.lazyload.enable && sco.lazyloadImg()
|
1006
1028
|
GLOBAL_CONFIG.lightbox && sco.lightbox('')
|
1007
1029
|
GLOBAL_CONFIG.randomlinks && randomLinksList()
|
1008
|
-
GLOBAL_CONFIG.comment.enable && newestCommentInit()
|
1009
1030
|
if (PAGE_CONFIG.comment) {
|
1010
1031
|
initComment()
|
1011
1032
|
}
|
@@ -1022,7 +1043,10 @@ window.refreshFn = () => {
|
|
1022
1043
|
sco.initConsoleState()
|
1023
1044
|
if (document.getElementById('history-baidu')) sco.card_history() // 那年今日
|
1024
1045
|
if (document.getElementById('welcome-info')) sco.card_welcome() // 个性定位
|
1025
|
-
if (GLOBAL_CONFIG.comment.type === "twikoo" && PAGE_CONFIG.comment)
|
1046
|
+
if (GLOBAL_CONFIG.comment.type === "twikoo" && PAGE_CONFIG.comment) {
|
1047
|
+
initializeCommentBarrage() // 热评
|
1048
|
+
GLOBAL_CONFIG.comment.enable && newestCommentInit()
|
1049
|
+
}
|
1026
1050
|
}
|
1027
1051
|
|
1028
1052
|
sco.initTheme()
|
File without changes
|
File without changes
|