hexo-theme-volantis 5.7.4 → 5.7.5
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 +8 -0
- package/package.json +1 -1
- package/scripts/tags/pandown.js +2 -2
- package/source/js/search/hexo.js +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.7.5](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.7.4...v5.7.5) (2022-08-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **pandown:** Uncaught TypeError: pandown is not a function ([371b1ec](https://github.com/volantis-x/hexo-theme-volantis/commit/371b1ece729a719f102854d3175ce440f90b4a14))
|
|
9
|
+
* search ([7f11915](https://github.com/volantis-x/hexo-theme-volantis/commit/7f11915c4c672f427a6044e2614ed85e7e052587))
|
|
10
|
+
|
|
3
11
|
## [5.7.4](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.7.3...v5.7.4) (2022-08-15)
|
|
4
12
|
|
|
5
13
|
|
package/package.json
CHANGED
package/scripts/tags/pandown.js
CHANGED
|
@@ -24,10 +24,10 @@ hexo.extend.tag.register('pandown', function(args) {
|
|
|
24
24
|
}
|
|
25
25
|
let result = '';
|
|
26
26
|
// js
|
|
27
|
-
result += '<div class="tag pandown-tags"
|
|
27
|
+
result += '<div class="tag pandown-tags">';
|
|
28
28
|
//pandown
|
|
29
29
|
result += '<pandown type="'+type+'" url="'+url+'" pwd="'+pwd+'" fname="'+fname+'"></pandown>'
|
|
30
30
|
//调用
|
|
31
|
-
result += '<script>pandown()</script></div>'
|
|
31
|
+
result += '<script>volantis.js("https://unpkg.com/pandown").then(pandown)</script></div>'
|
|
32
32
|
return result;
|
|
33
33
|
});
|
package/source/js/search/hexo.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
let SearchService = (() => {
|
|
2
|
-
fn = {};
|
|
2
|
+
const fn = {};
|
|
3
3
|
fn.queryText = null;
|
|
4
4
|
fn.data = null;
|
|
5
5
|
fn.template = `<div id="u-search">
|
|
@@ -58,8 +58,8 @@ let SearchService = (() => {
|
|
|
58
58
|
fn.data = await fn.fetchData();
|
|
59
59
|
}
|
|
60
60
|
let results = "";
|
|
61
|
-
results += fn.buildResultList(data.pages);
|
|
62
|
-
results += fn.buildResultList(data.posts);
|
|
61
|
+
results += fn.buildResultList(fn.data.pages);
|
|
62
|
+
results += fn.buildResultList(fn.data.posts);
|
|
63
63
|
document.querySelector("#u-search .modal-results").innerHTML = results;
|
|
64
64
|
window.pjax && pjax.refresh(document.querySelector("#u-search"));
|
|
65
65
|
document.addEventListener("keydown", function f(event) {
|
|
@@ -76,7 +76,7 @@ let SearchService = (() => {
|
|
|
76
76
|
return fetch(SearchServiceDataPath)
|
|
77
77
|
.then((response) => response.text())
|
|
78
78
|
.then((res) => {
|
|
79
|
-
data = JSON.parse(res);
|
|
79
|
+
const data = JSON.parse(res);
|
|
80
80
|
// console.log(data);
|
|
81
81
|
return data;
|
|
82
82
|
});
|
|
@@ -87,8 +87,8 @@ let SearchService = (() => {
|
|
|
87
87
|
if (post.text) {
|
|
88
88
|
post.text = post.text.replace(/12345\d*/g, "") // 简易移除代码行号
|
|
89
89
|
}
|
|
90
|
-
if (!post.title&&post.text) {
|
|
91
|
-
post.title = post.text.trim().slice(0,15)
|
|
90
|
+
if (!post.title && post.text) {
|
|
91
|
+
post.title = post.text.trim().slice(0, 15)
|
|
92
92
|
}
|
|
93
93
|
if (fn.contentSearch(post)) {
|
|
94
94
|
html += fn.buildResult(post.permalink, post.title, post.digest);
|