hexo-theme-volantis 5.7.1 → 5.7.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/CHANGELOG.md +25 -0
- package/_config.yml +9 -5
- package/layout/_partial/article.ejs +3 -3
- package/layout/_partial/footer.ejs +10 -6
- package/layout/_partial/head.ejs +1 -1
- package/layout/_partial/post.ejs +1 -1
- package/layout/_partial/scripts/_ctrl/cdnCtrl.ejs +2 -1
- package/layout/_partial/scripts/index.ejs +3 -1
- package/layout/_plugins/comments/discuss/script.ejs +2 -2
- package/package.json +1 -1
- package/scripts/filters/content-visibility.js +20 -18
- package/scripts/helpers/revisioned.js +2 -2
- package/source/css/_style/_plugins/_dark/dark_plugins.styl +0 -4
- package/source/css/first.styl +13 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.7.4](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.7.3...v5.7.4) (2022-08-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **#793:** 修复空值 ([302c98f](https://github.com/volantis-x/hexo-theme-volantis/commit/302c98fc5b0c725fb77c6bb33d7537f8f1f2062f))
|
|
9
|
+
|
|
10
|
+
## [5.7.3](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.7.2...v5.7.3) (2022-08-15)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **#781:** content_visibility: false ([0c719be](https://github.com/volantis-x/hexo-theme-volantis/commit/0c719be17e8affb28dd42c9c8bfb52e3e21d9790))
|
|
16
|
+
* **#793:** cdn_version: false ([cf60678](https://github.com/volantis-x/hexo-theme-volantis/commit/cf6067860312fbd6afd4ba6c14867d9ef86832fd))
|
|
17
|
+
* **#793:** 移除默认配置 ([4d82dff](https://github.com/volantis-x/hexo-theme-volantis/commit/4d82dff4d41c513cfa0124cbed7e42b60236d9de))
|
|
18
|
+
* **#798:** footer version link 404 ([a2a2d90](https://github.com/volantis-x/hexo-theme-volantis/commit/a2a2d90dc96fd00bb14cd742e0f05d253ef4ebed))
|
|
19
|
+
|
|
20
|
+
## [5.7.2](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.7.1...v5.7.2) (2022-08-01)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* fix Chinese urlencode displaying problem in permalink ([#794](https://github.com/volantis-x/hexo-theme-volantis/issues/794)) ([677b820](https://github.com/volantis-x/hexo-theme-volantis/commit/677b8207f7e0863470ffcb8fd9f287ca7ec1e9cf))
|
|
26
|
+
* 加引号处理herf属性中空格导致的地址错误 ([#796](https://github.com/volantis-x/hexo-theme-volantis/issues/796)) ([2bb4043](https://github.com/volantis-x/hexo-theme-volantis/commit/2bb4043bbf58eb6080e3e5743817ad4420409937))
|
|
27
|
+
|
|
3
28
|
## [5.7.1](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.7.0...v5.7.1) (2022-07-26)
|
|
4
29
|
|
|
5
30
|
|
package/_config.yml
CHANGED
|
@@ -50,17 +50,21 @@ cdn:
|
|
|
50
50
|
# 以下配置可以覆盖 cdn.prefix,配置项的值可以为空,但是要使用CDN必须依据路径填写配置项的键
|
|
51
51
|
set:
|
|
52
52
|
js:
|
|
53
|
-
app: /js/app.js
|
|
53
|
+
#app: /js/app.js
|
|
54
54
|
css:
|
|
55
|
-
style: /css/style.css # (异步加载样式)
|
|
55
|
+
#style: /css/style.css # (异步加载样式)
|
|
56
56
|
# 静态资源版本控制
|
|
57
57
|
# 本地文件使用文件内容的hash值作为版本号(app.8c1e7c88.js) 其他为时间戳 (?time=1648684470140)
|
|
58
58
|
# 建议静态资源设置标头 浏览器缓存一年边缘缓存一个月 cache-control: max-age=86400, s-maxage=31536000 如果有更新记得刷新缓存
|
|
59
|
-
cdn_version:
|
|
59
|
+
cdn_version: false
|
|
60
60
|
# volantis static 静态资源文件 npm 包 CDN 地址 (后面加 "/" )
|
|
61
61
|
# https://github.com/volantis-x/volantis-static
|
|
62
62
|
volantis_static_cdn: https://unpkg.com/volantis-static@0.0.1654736714924/
|
|
63
63
|
########################################################################
|
|
64
|
+
# https://web.dev/content-visibility/
|
|
65
|
+
# https://www.caniuse.com/?search=content-visibility
|
|
66
|
+
content_visibility: false
|
|
67
|
+
|
|
64
68
|
# 全局页面字符串替换 A => B (可用于临时修改错字等)
|
|
65
69
|
replace:
|
|
66
70
|
- https://cdn.jsdelivr.net/npm/ => https://unpkg.com/
|
|
@@ -475,7 +479,7 @@ comments:
|
|
|
475
479
|
# Discuss
|
|
476
480
|
# https://discuss.js.org
|
|
477
481
|
discuss:
|
|
478
|
-
js: https://cdn.jsdelivr.net/npm/discuss/dist/
|
|
482
|
+
js: https://cdn.jsdelivr.net/npm/discuss/dist/discuss.js # 建议锁定版本
|
|
479
483
|
serverURLs: # Discuss server address url
|
|
480
484
|
# https://discuss.js.org/Quick-Start.html#path
|
|
481
485
|
|
|
@@ -733,7 +737,7 @@ plugins:
|
|
|
733
737
|
|
|
734
738
|
# https://scrollrevealjs.org/api/reveal.html
|
|
735
739
|
scrollreveal:
|
|
736
|
-
enable: true
|
|
740
|
+
enable: #true
|
|
737
741
|
js: volantis-static/libs/scrollreveal/dist/scrollreveal.min.js # https://unpkg.com/scrollreveal@4.0.9/dist/scrollreveal.min.js
|
|
738
742
|
distance: 32px
|
|
739
743
|
duration: 800 # ms
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<article itemscope itemtype="http://schema.org/Article" class="article post white-box reveal md <%- theme.custom_css.body.effect.join(' ') %> article-type-<%= post.layout %>" id="<%= post.layout %>" itemscope itemprop="blogPost">
|
|
2
|
-
<link itemprop="mainEntityOfPage" href="<%- post.permalink %>">
|
|
2
|
+
<link itemprop="mainEntityOfPage" href="<%- decodeURI(post.permalink) %>">
|
|
3
3
|
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
|
|
4
4
|
<meta itemprop="name" content="<%- config.title %>">
|
|
5
5
|
</span>
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
%>
|
|
70
70
|
<div class="copyright license">
|
|
71
71
|
<div class="license-title"><%- post.title %></div>
|
|
72
|
-
<div class="license-link"><a href="<%- page.permalink %>"><%- page.permalink %></a>
|
|
72
|
+
<div class="license-link"><a href="<%- decodeURI(page.permalink) %>"><%- decodeURI(page.permalink) %></a>
|
|
73
73
|
</div>
|
|
74
74
|
<div class="license-meta">
|
|
75
75
|
<div class="license-meta-item">
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
<blockquote>
|
|
107
107
|
<% (footer_widget.copyright.content||[]).forEach(function(row){ %>
|
|
108
108
|
<% if (row == 'permalink') { %>
|
|
109
|
-
<p><%- footer_widget.copyright.permalink %><a href
|
|
109
|
+
<p><%- footer_widget.copyright.permalink %><a href="<%- decodeURI(page.permalink) %>"><%- decodeURI(page.permalink) %></a></p>
|
|
110
110
|
<% } else { %>
|
|
111
111
|
<%- markdown(row) %>
|
|
112
112
|
<% } %>
|
|
@@ -5,10 +5,14 @@
|
|
|
5
5
|
layout = config.theme_config.footer.layout;
|
|
6
6
|
}
|
|
7
7
|
let theme_version = theme.info.theme_version
|
|
8
|
-
// 未发布的 alpha 版本
|
|
9
|
-
if (theme_version.indexOf("alpha")!=-1) {
|
|
10
|
-
|
|
11
|
-
}
|
|
8
|
+
// // 未发布的 alpha 版本
|
|
9
|
+
// if (theme_version.indexOf("alpha")!=-1) {
|
|
10
|
+
// theme_version = "dev"
|
|
11
|
+
// }
|
|
12
|
+
// // 从 5.7.2 以后的版本以 v开头(release-please的奇怪设定)
|
|
13
|
+
// else if (theme_version.indexOf("beta")==-1||theme_version.indexOf("rc")==-1) {
|
|
14
|
+
// theme_version = "v" + theme_version
|
|
15
|
+
// }
|
|
12
16
|
%>
|
|
13
17
|
<footer class="footer clearfix" itemscope itemtype="http://schema.org/WPFooter">
|
|
14
18
|
<br><br>
|
|
@@ -39,13 +43,13 @@
|
|
|
39
43
|
<div><%- markdown(__('footer.license')) %></div>
|
|
40
44
|
<% } else if (item == 'info') { %>
|
|
41
45
|
<%- __('footer.use') %>
|
|
42
|
-
<a href="https://github.com/volantis-x/hexo-theme-volantis
|
|
46
|
+
<a href="https://github.com/volantis-x/hexo-theme-volantis/#<%- theme_version %>" target="_blank" class="codename">Volantis</a>
|
|
43
47
|
<%- __('footer.theme') %><% if (theme.analytics.busuanzi) { %><%- __('symbol.comma') %><%- __('footer.total_views') %>
|
|
44
48
|
<span id="busuanzi_value_site_pv"><i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i></span>
|
|
45
49
|
<%- __('footer.times') %>
|
|
46
50
|
<% } %>
|
|
47
51
|
<% } else if (item == 'source') { %>
|
|
48
|
-
<%- markdown(__('footer.site_source', '[Volantis](https://github.com/volantis-x/hexo-theme-volantis
|
|
52
|
+
<%- markdown(__('footer.site_source', '[Volantis](https://github.com/volantis-x/hexo-theme-volantis/#'+theme_version+')', 'GitHub', 'https://github.com/volantis-x/volantis-docs')) %>
|
|
49
53
|
<% } else if (item == 'copyright') { %>
|
|
50
54
|
<div class='copyright'>
|
|
51
55
|
<%- markdown(theme.site_footer.copyright) %>
|
package/layout/_partial/head.ejs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<head hexo-theme='https://github.com/volantis-x/hexo-theme-volantis
|
|
1
|
+
<head hexo-theme='https://github.com/volantis-x/hexo-theme-volantis/#<%- theme.info.theme_version %>'>
|
|
2
2
|
<%- meta_generator() %>
|
|
3
3
|
<meta name="Volantis" content="<%- theme.info.theme_version %>">
|
|
4
4
|
<meta charset="utf-8">
|
package/layout/_partial/post.ejs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div class="post post-v3 white-box reveal <%- theme.custom_css.body.effect.join(' ') %>" itemscope itemtype="http://schema.org/Article" >
|
|
2
|
-
<link itemprop="mainEntityOfPage" href="<%- post.permalink %>">
|
|
2
|
+
<link itemprop="mainEntityOfPage" href="<%- decodeURI(post.permalink) %>">
|
|
3
3
|
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
|
|
4
4
|
<meta itemprop="name" content="<%- config.title %>">
|
|
5
5
|
</span>
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
const element = n[key];
|
|
66
66
|
if(element && typeof element !="string"){
|
|
67
67
|
dfs(element,path.concat(key))
|
|
68
|
-
}else{
|
|
68
|
+
}else if(element){
|
|
69
69
|
let op=path.concat(key)
|
|
70
70
|
let source=""
|
|
71
71
|
for (let index = 1; index < op.length; index++) {
|
|
@@ -122,5 +122,6 @@
|
|
|
122
122
|
// ?time=' + Date.now() 替换为 theme.getStartTime 保证相同资源 hash 不变
|
|
123
123
|
// 更新:
|
|
124
124
|
// 本地文件使用文件内容的hash值作为版本号 app.8c1e7c88.js see: /scripts/helpers/revisioned.js
|
|
125
|
+
|
|
125
126
|
dfs(theme.cdn.set,[])
|
|
126
127
|
_%>
|
|
@@ -136,7 +136,9 @@
|
|
|
136
136
|
|
|
137
137
|
<%- partial('toc') %>
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
<% if (theme.content_visibility) { %>
|
|
140
|
+
<%- partial('content-visibility-scroll-fix') %>
|
|
141
|
+
<% } %>
|
|
140
142
|
|
|
141
143
|
<%- partial('../../_plugins/slow-network/script') %>
|
|
142
144
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
path = defaultPath || decodeURI(window.location.pathname);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
discuss.init(Object.assign(Object.assign(<%- JSON.stringify(theme.comments.discuss) %>, {
|
|
17
17
|
el: '#discuss_container',
|
|
18
18
|
path: path,
|
|
19
19
|
ph: placeholder
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
load_discuss();
|
|
23
23
|
volantis.pjax.push(()=>{
|
|
24
|
-
if (typeof
|
|
24
|
+
if (typeof discuss == "undefined") {
|
|
25
25
|
load_discuss();
|
|
26
26
|
} else {
|
|
27
27
|
pjax_discuss();
|
package/package.json
CHANGED
|
@@ -2,24 +2,26 @@
|
|
|
2
2
|
// https://www.caniuse.com/?search=content-visibility
|
|
3
3
|
// 在文章内容渲染时将每两个 <h2> 之间的内容分为一块 用 <div class="post-story"></div> 包裹起来。然后为 .post-story 声明 content-visibility: auto
|
|
4
4
|
hexo.extend.filter.register('after_post_render', function (data) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
flag
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
5
|
+
if (this.theme.config.content_visibility) {
|
|
6
|
+
let dataList = data.content.split('\n')
|
|
7
|
+
let mydata = ``
|
|
8
|
+
let flag = 1
|
|
9
|
+
dataList.forEach(e => {
|
|
10
|
+
let yy = e.replace(/<h2.*?>.*?<\/h2>/, function (str) {
|
|
11
|
+
if (flag) {
|
|
12
|
+
flag = 0
|
|
13
|
+
return `<div class="story post-story">` + str
|
|
14
|
+
} else {
|
|
15
|
+
return `</div><div class="story post-story">` + str
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
mydata += yy
|
|
19
|
+
mydata += "\n"
|
|
20
|
+
});
|
|
21
|
+
if (!flag) {
|
|
22
|
+
mydata += `</div>`
|
|
23
|
+
}
|
|
24
|
+
data.content = mydata
|
|
22
25
|
}
|
|
23
|
-
data.content = mydata
|
|
24
26
|
return data;
|
|
25
27
|
});
|
|
@@ -62,7 +62,7 @@ const getRevisionedFilePath = (filePath, revision) => {
|
|
|
62
62
|
|
|
63
63
|
const revisioned = (filePath) => {
|
|
64
64
|
if (!hexo.theme.config.cdn_version) {
|
|
65
|
-
return;
|
|
65
|
+
return filePath;
|
|
66
66
|
}
|
|
67
67
|
let arg = process.argv[2];
|
|
68
68
|
if (arg == "s" || arg == "server") {
|
|
@@ -160,7 +160,7 @@ const replaceRevisionPlaceholder = async () => {
|
|
|
160
160
|
})
|
|
161
161
|
);
|
|
162
162
|
} catch (error) {
|
|
163
|
-
|
|
163
|
+
hexo.log.error("cdn_version ERROR: " + error);
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
166
|
|
|
@@ -123,10 +123,6 @@ if hexo-config('comments.service')=='twikoo'
|
|
|
123
123
|
.OwO-items-image
|
|
124
124
|
.OwO-item:hover
|
|
125
125
|
background-color: #252627 !important
|
|
126
|
-
|
|
127
|
-
if hexo-config('comments.service')=='discuss'
|
|
128
|
-
#Discuss .D-emot
|
|
129
|
-
background: #333841
|
|
130
126
|
|
|
131
127
|
// Custom Files
|
|
132
128
|
for $injects_dark in hexo-config('injects.dark')
|
package/source/css/first.styl
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
#safearea {
|
|
2
2
|
display: none
|
|
3
3
|
}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
|
|
5
|
+
if hexo-config('content_visibility')
|
|
6
|
+
// https://web.dev/content-visibility/
|
|
7
|
+
// https://www.caniuse.com/?search=content-visibility
|
|
8
|
+
/*
|
|
9
|
+
* Workaround for Chrome bug, part 1
|
|
10
|
+
* Chunk rendering for all but the first article.
|
|
11
|
+
* /layout/_partial/scripts/content-visibility-scroll-fix.ejs
|
|
12
|
+
*/
|
|
13
|
+
.post-story + .post-story{
|
|
14
|
+
content-visibility: auto;
|
|
15
|
+
contain-intrinsic-size: 10px 500px;
|
|
16
|
+
}
|
|
15
17
|
|
|
16
18
|
@import '_defines/*'
|
|
17
19
|
|