hexo-theme-volantis 5.7.2 → 5.7.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/CHANGELOG.md +10 -0
- package/_config.yml +8 -4
- package/layout/_partial/footer.ejs +10 -6
- package/layout/_partial/head.ejs +1 -1
- package/layout/_partial/scripts/index.ejs +3 -1
- package/package.json +1 -1
- package/scripts/filters/content-visibility.js +20 -18
- package/scripts/helpers/revisioned.js +1 -1
- package/source/css/first.styl +13 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.7.3](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.7.2...v5.7.3) (2022-08-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **#781:** content_visibility: false ([0c719be](https://github.com/volantis-x/hexo-theme-volantis/commit/0c719be17e8affb28dd42c9c8bfb52e3e21d9790))
|
|
9
|
+
* **#793:** cdn_version: false ([cf60678](https://github.com/volantis-x/hexo-theme-volantis/commit/cf6067860312fbd6afd4ba6c14867d9ef86832fd))
|
|
10
|
+
* **#793:** 移除默认配置 ([4d82dff](https://github.com/volantis-x/hexo-theme-volantis/commit/4d82dff4d41c513cfa0124cbed7e42b60236d9de))
|
|
11
|
+
* **#798:** footer version link 404 ([a2a2d90](https://github.com/volantis-x/hexo-theme-volantis/commit/a2a2d90dc96fd00bb14cd742e0f05d253ef4ebed))
|
|
12
|
+
|
|
3
13
|
## [5.7.2](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.7.1...v5.7.2) (2022-08-01)
|
|
4
14
|
|
|
5
15
|
|
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/
|
|
@@ -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
|
|
@@ -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">
|
|
@@ -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
|
|
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
|
});
|
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
|
|