hexo-theme-solitude 1.2.2 → 1.2.3
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 +17 -2
- package/layout/includes/inject/body.pug +2 -3
- package/layout/includes/inject/head.pug +1 -1
- package/layout/includes/widgets/aside/asideTag.pug +1 -1
- package/layout/includes/widgets/home/postList.pug +20 -21
- package/layout/index.pug +2 -1
- 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/_mode/index.styl +49 -5
- package/source/js/extend/{console/comment.js → comment/twikoo.js} +0 -1
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 # 字数统计
|
@@ -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
|
@@ -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))
|
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/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)
|