hexo-theme-stellar 1.24.0 → 1.25.0
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 +69 -45
- package/languages/en.yml +2 -1
- package/languages/zh-CN.yml +2 -1
- package/languages/zh-TW.yml +2 -1
- package/layout/404.ejs +1 -3
- package/layout/_partial/head.ejs +1 -1
- package/layout/_partial/main/article/article_footer.ejs +14 -14
- package/layout/_partial/main/article/read_next.ejs +10 -10
- package/layout/_partial/main/navbar/breadcrumb.ejs +36 -14
- package/layout/_partial/main/navbar/{list_post.ejs → nav_tabs_blog.ejs} +15 -7
- package/layout/_partial/main/navbar/{list_wiki.ejs → nav_tabs_wiki.ejs} +15 -1
- package/layout/_partial/main/post_list/post_card.ejs +2 -13
- package/layout/_partial/main/post_list/topic_card.ejs +16 -0
- package/layout/_partial/sidebar/header.ejs +6 -7
- package/layout/_partial/sidebar/index.ejs +37 -29
- package/layout/_partial/sidebar/menu.ejs +2 -2
- package/layout/_partial/widgets/related.ejs +47 -20
- package/layout/_partial/widgets/search.ejs +2 -2
- package/layout/_partial/widgets/toc.ejs +52 -44
- package/layout/archive.ejs +1 -1
- package/layout/categories.ejs +1 -1
- package/layout/index.ejs +6 -42
- package/layout/index_topic.ejs +28 -0
- package/layout/index_wiki.ejs +42 -0
- package/layout/page.ejs +2 -2
- package/layout/tags.ejs +1 -1
- package/layout/topic.ejs +28 -0
- package/layout/wiki.ejs +11 -22
- package/package.json +1 -1
- package/scripts/events/index.js +5 -0
- package/scripts/events/lib/authors.js +1 -1
- package/scripts/events/lib/config.js +2 -2
- package/scripts/events/lib/doc_tree.js +1 -1
- package/scripts/events/lib/merge_posts.js +47 -0
- package/scripts/events/lib/topic_tree.js +45 -0
- package/scripts/generators/404.js +8 -3
- package/scripts/generators/author.js +4 -2
- package/scripts/generators/categories.js +4 -4
- package/scripts/generators/tags.js +4 -4
- package/scripts/generators/topic.js +21 -0
- package/scripts/generators/wiki.js +29 -28
- package/scripts/helpers/parse_config.js +2 -2
- package/scripts/tags/lib/audio.js +10 -5
- package/scripts/tags/lib/navbar.js +1 -1
- package/scripts/tags/lib/video.js +13 -5
- package/source/css/_common/blur.styl +4 -1
- package/source/css/_common/highlight.styl +1 -0
- package/source/css/_common/media.styl +1 -6
- package/source/css/_layout/partial/paginator.styl +2 -2
- package/source/css/_layout/partial/related.styl +3 -0
- package/source/css/_layout/tag-plugins/banner.styl +4 -1
- package/source/css/_layout/tag-plugins/frame.styl +1 -1
- package/source/css/_layout/tag-plugins/media.styl +11 -0
- package/source/css/_layout/widgets/search.styl +21 -29
- package/source/js/main.js +1 -1
- package/source/js/plugins/fcircle.js +1 -1
- package/source/js/plugins/friends.js +1 -1
- package/source/js/plugins/memos.js +1 -1
- package/source/js/plugins/sites.js +2 -2
- package/source/js/plugins/weibo.js +1 -1
- package/source/js/search/local-search.js +4 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* topic.js v1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
+
* 用于专栏/专题文章,一个专栏类似于 wiki 模块中的一个项目文档
|
|
4
|
+
* 区别是:
|
|
5
|
+
* 1. 按发布日期排序,无需手动排序
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
function getTopicTree(ctx) {
|
|
12
|
+
var tree = {}
|
|
13
|
+
const data = ctx.locals.get('data')
|
|
14
|
+
var list = []
|
|
15
|
+
for (let key of Object.keys(data)) {
|
|
16
|
+
if (key.startsWith('topic/') && key.length > 5) {
|
|
17
|
+
let newKey = key.replace('topic/', '')
|
|
18
|
+
let obj = data[key]
|
|
19
|
+
obj.id = newKey
|
|
20
|
+
if (obj.order_by == null) {
|
|
21
|
+
obj.order_by = '-date'
|
|
22
|
+
}
|
|
23
|
+
if (obj.path == null) {
|
|
24
|
+
obj.path = `/topic/${newKey}/`
|
|
25
|
+
}
|
|
26
|
+
obj.pages = []
|
|
27
|
+
list.push(obj)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
for (let item of list) {
|
|
31
|
+
tree[item.id] = item
|
|
32
|
+
}
|
|
33
|
+
return tree
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module.exports = ctx => {
|
|
37
|
+
var topic = ctx.locals.get('data').topic || {}
|
|
38
|
+
// 专栏结构树
|
|
39
|
+
topic.tree = getTopicTree(ctx)
|
|
40
|
+
// 索引页显示的专栏列表
|
|
41
|
+
if (topic.publish_list == null) {
|
|
42
|
+
topic.publish_list = Object.keys(topic.tree)
|
|
43
|
+
}
|
|
44
|
+
ctx.theme.config.topic = topic
|
|
45
|
+
}
|
|
@@ -3,8 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
hexo.extend.generator.register('404', function (locals) {
|
|
6
|
+
const { site_tree } = hexo.theme.config
|
|
6
7
|
return {
|
|
7
|
-
path: '
|
|
8
|
-
layout: ['404']
|
|
8
|
+
path: site_tree.error_page['404'],
|
|
9
|
+
layout: ['404'],
|
|
10
|
+
data: {
|
|
11
|
+
layout: '404',
|
|
12
|
+
menu_id: site_tree.error_page.menu_id
|
|
13
|
+
}
|
|
9
14
|
}
|
|
10
|
-
})
|
|
15
|
+
})
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
hexo.extend.generator.register('author', function (locals) {
|
|
6
|
-
const { authors } = hexo.theme.config
|
|
6
|
+
const { site_tree, authors } = hexo.theme.config
|
|
7
7
|
var pages = []
|
|
8
8
|
for (let key of Object.keys(authors)) {
|
|
9
9
|
const author = authors[key]
|
|
@@ -14,7 +14,9 @@ hexo.extend.generator.register('author', function (locals) {
|
|
|
14
14
|
path: author.path,
|
|
15
15
|
layout: ['archive'],
|
|
16
16
|
data: {
|
|
17
|
-
|
|
17
|
+
author: author,
|
|
18
|
+
sidebar: site_tree.author.sidebar,
|
|
19
|
+
menu_id: site_tree.author.menu_id
|
|
18
20
|
}
|
|
19
21
|
})
|
|
20
22
|
}
|
|
@@ -6,10 +6,10 @@ hexo.extend.generator.register('categories', function (locals) {
|
|
|
6
6
|
if (locals.categories && locals.categories.length > 0) {
|
|
7
7
|
return {
|
|
8
8
|
path: hexo.config.category_dir + '/index.html',
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
layout: ['categories'],
|
|
10
|
+
data: locals.posts
|
|
11
11
|
}
|
|
12
12
|
} else {
|
|
13
|
-
return {}
|
|
13
|
+
return {}
|
|
14
14
|
}
|
|
15
|
-
})
|
|
15
|
+
})
|
|
@@ -6,10 +6,10 @@ hexo.extend.generator.register('tags', function (locals) {
|
|
|
6
6
|
if (locals.tags && locals.tags.length > 0) {
|
|
7
7
|
return {
|
|
8
8
|
path: hexo.config.tag_dir + '/index.html',
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
layout: ['tags'],
|
|
10
|
+
data: locals.posts
|
|
11
11
|
}
|
|
12
12
|
} else {
|
|
13
|
-
return {}
|
|
13
|
+
return {}
|
|
14
14
|
}
|
|
15
|
-
})
|
|
15
|
+
})
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* topic v1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
hexo.extend.generator.register('topic', function (locals) {
|
|
6
|
+
const { site_tree, topic } = hexo.theme.config
|
|
7
|
+
const topicIdList = Object.keys(topic.tree)
|
|
8
|
+
if (topicIdList.length == 0) {
|
|
9
|
+
return {}
|
|
10
|
+
}
|
|
11
|
+
var ret = []
|
|
12
|
+
ret.push({
|
|
13
|
+
path: site_tree.topic.base_dir + '/index.html',
|
|
14
|
+
layout: ['index_topic'],
|
|
15
|
+
data: {
|
|
16
|
+
layout: 'index_topic',
|
|
17
|
+
menu_id: site_tree.topic.menu_id
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
return ret
|
|
21
|
+
})
|
|
@@ -3,34 +3,35 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
hexo.extend.generator.register('wiki', function (locals) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const { site_tree, wiki } = hexo.theme.config
|
|
7
|
+
const wikiIdList = Object.keys(wiki.tree)
|
|
8
|
+
if (wikiIdList.length == 0) {
|
|
9
|
+
return {}
|
|
10
|
+
}
|
|
11
|
+
var ret = []
|
|
12
|
+
ret.push({
|
|
13
|
+
path: site_tree.wiki.base_dir + '/index.html',
|
|
14
|
+
layout: ['index_wiki'],
|
|
15
|
+
data: {
|
|
16
|
+
layout: 'index_wiki',
|
|
17
|
+
menu_id: site_tree.wiki.menu_id,
|
|
18
|
+
filter: false
|
|
10
19
|
}
|
|
11
|
-
})
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
'filter': true,
|
|
26
|
-
'tagName': tag.name
|
|
27
|
-
},
|
|
28
|
-
layout: ['wiki']
|
|
29
|
-
});
|
|
30
|
-
}
|
|
20
|
+
})
|
|
21
|
+
if (wiki.all_tags) {
|
|
22
|
+
for (let id of Object.keys(wiki.all_tags)) {
|
|
23
|
+
let tag = wiki.all_tags[id]
|
|
24
|
+
ret.push({
|
|
25
|
+
path: tag.path,
|
|
26
|
+
layout: ['index_wiki'],
|
|
27
|
+
data: {
|
|
28
|
+
layout: 'index_wiki',
|
|
29
|
+
menu_id: site_tree.wiki.menu_id,
|
|
30
|
+
filter: true,
|
|
31
|
+
tagName: tag.name
|
|
32
|
+
}
|
|
33
|
+
})
|
|
31
34
|
}
|
|
32
|
-
return ret;
|
|
33
|
-
} else {
|
|
34
|
-
return {};
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
return ret
|
|
37
|
+
})
|
|
@@ -9,14 +9,19 @@
|
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
11
11
|
module.exports = ctx => function(args) {
|
|
12
|
-
args = ctx.args.map(args, ['type'], ['src'])
|
|
13
|
-
if (args.
|
|
14
|
-
|
|
12
|
+
args = ctx.args.map(args, ['type', 'netease', 'autoplay'], ['src'])
|
|
13
|
+
if (args.netease) {
|
|
14
|
+
return `
|
|
15
|
+
<div class="tag-plugin audio">
|
|
16
|
+
<iframe src="//music.163.com/outchain/player?type=${args.type || '2'}&id=${args.netease}&auto=${args.autoplay == 'true' ? '1' : '0'}&height=32" frameborder="no" border="0" marginwidth="0" marginheight="0" width=288px height=52>
|
|
17
|
+
</iframe>
|
|
18
|
+
</div>
|
|
19
|
+
`
|
|
15
20
|
}
|
|
16
21
|
return `
|
|
17
|
-
<div class="tag-plugin
|
|
22
|
+
<div class="tag-plugin audio">
|
|
18
23
|
<audio controls preload>
|
|
19
|
-
<source src="${args.src}" type="${args.type}">Your browser does not support the audio tag.
|
|
24
|
+
<source src="${args.src}" type="${args.type || 'audio/mp3'}">Your browser does not support the audio tag.
|
|
20
25
|
</audio>
|
|
21
26
|
</div>
|
|
22
27
|
`
|
|
@@ -25,7 +25,7 @@ module.exports = ctx => function(args) {
|
|
|
25
25
|
let text = matches[1]
|
|
26
26
|
let href = matches[2]
|
|
27
27
|
if (href == args.active) {
|
|
28
|
-
el += `<a class="link
|
|
28
|
+
el += `<a class="link active" href="${href}">${text}</a>`
|
|
29
29
|
} else {
|
|
30
30
|
el += `<a class="link" href="${href}">${text}</a>`
|
|
31
31
|
}
|
|
@@ -9,14 +9,22 @@
|
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
11
11
|
module.exports = ctx => function(args) {
|
|
12
|
-
args = ctx.args.map(args, ['type'], ['src'])
|
|
13
|
-
if (args.
|
|
14
|
-
args.
|
|
12
|
+
args = ctx.args.map(args, ['type', 'bilibili', 'ratio', 'width', 'autoplay'], ['src'])
|
|
13
|
+
if (args.width == null) {
|
|
14
|
+
args.width = '100%'
|
|
15
|
+
}
|
|
16
|
+
if (args.bilibili) {
|
|
17
|
+
return `
|
|
18
|
+
<div class="tag-plugin video" style="aspect-ratio:${args.ratio || 16/9};max-width:${args.width};">
|
|
19
|
+
<iframe src="https://player.bilibili.com/player.html?bvid=${args.bilibili}&autoplay=${args.autoplay || 'false'}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true">
|
|
20
|
+
</iframe>
|
|
21
|
+
</div>
|
|
22
|
+
`
|
|
15
23
|
}
|
|
16
24
|
return `
|
|
17
|
-
<div class="tag-plugin video">
|
|
25
|
+
<div class="tag-plugin video" style="max-width:${args.width};">
|
|
18
26
|
<video controls preload>
|
|
19
|
-
<source src="${args.src}" type="${args.type}">Your browser does not support the video tag.
|
|
27
|
+
<source src="${args.src}" type="${args.type || 'video/mp4'}">Your browser does not support the video tag.
|
|
20
28
|
</video>
|
|
21
29
|
</div>
|
|
22
30
|
`
|
|
@@ -9,7 +9,7 @@ if hexo-config('style.darkmode') == 'always'
|
|
|
9
9
|
:root
|
|
10
10
|
--blur-bg: alpha(black, .5)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
blur-effect()
|
|
13
13
|
background: var(--blur-bg)
|
|
14
14
|
@supports ((-webkit-backdrop-filter:blur(var(--blur-px))) or (backdrop-filter:blur(var(--blur-px))))
|
|
15
15
|
background: var(--blur-bg) !important
|
|
@@ -17,3 +17,6 @@ if hexo-config('style.darkmode') == 'always'
|
|
|
17
17
|
-webkit-backdrop-filter: saturate(200%) blur(var(--blur-px))
|
|
18
18
|
&:hover
|
|
19
19
|
background: var(--card)
|
|
20
|
+
|
|
21
|
+
.blur
|
|
22
|
+
blur-effect()
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
background-clip: content-box
|
|
29
29
|
&.next
|
|
30
30
|
border-left: 1px dashed var(--block-border)
|
|
31
|
-
background-image: url('https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.
|
|
31
|
+
background-image: url('https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.12/arrow/064b95430caf4.svg')
|
|
32
32
|
&.prev
|
|
33
33
|
border-right: 1px dashed var(--block-border)
|
|
34
|
-
background-image: url('https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.
|
|
34
|
+
background-image: url('https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.12/arrow/f049bbd4e88ec.svg')
|
|
35
35
|
.current
|
|
36
36
|
font-family: $ff-code
|
|
37
37
|
background: var(--block)
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
margin-top: 19px
|
|
28
28
|
margin-bottom: 20px
|
|
29
29
|
.frame
|
|
30
|
-
background-image: url(https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.
|
|
30
|
+
background-image: url(https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.12/frame/iphone11.svg);
|
|
31
31
|
width: 329px
|
|
32
32
|
height: 658px
|
|
33
33
|
&[focus='top']
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
.widgets .widget-wrapper.search
|
|
2
|
-
margin-top: 1rem
|
|
3
2
|
margin-bottom: 0
|
|
4
3
|
|
|
5
4
|
.search-wrapper
|
|
@@ -12,36 +11,22 @@
|
|
|
12
11
|
align-items: center
|
|
13
12
|
transition: 0.38s ease-out
|
|
14
13
|
z-index: 0
|
|
15
|
-
&:after
|
|
16
|
-
content: ''
|
|
17
|
-
position absolute
|
|
18
|
-
left: 0
|
|
19
|
-
right: 0
|
|
20
|
-
bottom: 0
|
|
21
|
-
height: 2px
|
|
22
|
-
border-radius: 4px
|
|
23
|
-
background: convert(hexo-config('style.gradient.search'))
|
|
24
|
-
background-size: 200%
|
|
25
|
-
animation: glow 10s linear infinite
|
|
26
|
-
@keyframes glow {
|
|
27
|
-
from {
|
|
28
|
-
background-position: 0%
|
|
29
|
-
}
|
|
30
|
-
to {
|
|
31
|
-
background-position: 200%
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
14
|
.search-input
|
|
35
15
|
width: 100%
|
|
36
16
|
padding: 0.5rem 0
|
|
37
|
-
line-height: 1
|
|
17
|
+
line-height: 1.5
|
|
38
18
|
box-sizing: border-box
|
|
39
19
|
font-family: $ff-body
|
|
20
|
+
font-size: $fs-13
|
|
40
21
|
color: var(--text-p0)
|
|
22
|
+
|
|
41
23
|
|
|
42
|
-
&.noresult
|
|
24
|
+
&.noresult[searching='true']
|
|
43
25
|
.search-icon
|
|
44
|
-
|
|
26
|
+
path[p-id="1562"]
|
|
27
|
+
color: $c-red
|
|
28
|
+
.search-form
|
|
29
|
+
border: 1px solid $c-red
|
|
45
30
|
|
|
46
31
|
.search-no-result
|
|
47
32
|
display: none
|
|
@@ -88,22 +73,29 @@
|
|
|
88
73
|
|
|
89
74
|
|
|
90
75
|
|
|
91
|
-
.search-wrapper.noresult
|
|
76
|
+
.search-wrapper.noresult[searching='true']
|
|
92
77
|
.search-no-result
|
|
93
78
|
display: block
|
|
94
79
|
|
|
95
80
|
.widget-wrapper
|
|
96
81
|
.search-form
|
|
97
82
|
top: 0
|
|
98
|
-
background: var(--
|
|
83
|
+
background: var(--card)
|
|
84
|
+
border: 1px solid var(--block-border)
|
|
85
|
+
border-radius: $border-bar
|
|
99
86
|
.search-input
|
|
100
|
-
|
|
87
|
+
text-indent: 0.75rem
|
|
88
|
+
padding-right: 2rem
|
|
101
89
|
.search-icon
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
90
|
+
margin: 2px
|
|
91
|
+
position absolute
|
|
92
|
+
right: 0
|
|
105
93
|
pointer-events: none
|
|
106
94
|
color: var(--text-p2)
|
|
95
|
+
padding: 0.5rem
|
|
96
|
+
border-radius: 'calc(%s - 2px)' % $border-bar
|
|
97
|
+
path[p-id="1562"]
|
|
98
|
+
color: $color-theme
|
|
107
99
|
|
|
108
100
|
#search-result,.search-no-result
|
|
109
101
|
margin-top: 1rem
|
package/source/js/main.js
CHANGED
|
@@ -362,7 +362,7 @@ if (stellar.search.service) {
|
|
|
362
362
|
}
|
|
363
363
|
path = stellar.config.root + path;
|
|
364
364
|
const filter = $inputArea.attr('data-filter') || '';
|
|
365
|
-
searchFunc(path, filter, 'search-input', 'search-result');
|
|
365
|
+
searchFunc(path, filter, 'search-wrapper', 'search-input', 'search-result');
|
|
366
366
|
});
|
|
367
367
|
$inputArea.keydown(function(e) {
|
|
368
368
|
if (e.which == 13) {
|
|
@@ -86,7 +86,7 @@ $(function () {
|
|
|
86
86
|
var cfg = new Object();
|
|
87
87
|
cfg.el = el;
|
|
88
88
|
cfg.api = api;
|
|
89
|
-
cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.
|
|
89
|
+
cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.12/avatar/round/3442075.svg';
|
|
90
90
|
FCircle.layoutDiv(cfg);
|
|
91
91
|
}
|
|
92
92
|
});
|
|
@@ -78,7 +78,7 @@ $(function () {
|
|
|
78
78
|
cfg.el = el;
|
|
79
79
|
cfg.api = api;
|
|
80
80
|
cfg.class = el.getAttribute('class');
|
|
81
|
-
cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.
|
|
81
|
+
cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.12/avatar/round/3442075.svg';
|
|
82
82
|
friendsjs.layout(cfg);
|
|
83
83
|
}
|
|
84
84
|
});
|
|
@@ -126,7 +126,7 @@ $(function () {
|
|
|
126
126
|
cfg.host = api.replace(/https:\/\/(.*?)\/(.*)/i, '$1');
|
|
127
127
|
cfg.avatar = el.getAttribute('avatar');
|
|
128
128
|
if (!cfg.avatar) {
|
|
129
|
-
cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.
|
|
129
|
+
cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.12/avatar/round/3442075.svg';
|
|
130
130
|
}
|
|
131
131
|
MemosJS.layoutDiv(cfg);
|
|
132
132
|
}
|
|
@@ -80,8 +80,8 @@ $(function () {
|
|
|
80
80
|
cfg.class = el.getAttribute('class');
|
|
81
81
|
cfg.el = el;
|
|
82
82
|
cfg.api = api;
|
|
83
|
-
cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.
|
|
84
|
-
cfg.screenshot = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.
|
|
83
|
+
cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.12/link/8f277b4ee0ecd.svg';
|
|
84
|
+
cfg.screenshot = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.12/cover/76b86c0226ffd.svg';
|
|
85
85
|
sitesjs.layout(cfg);
|
|
86
86
|
}
|
|
87
87
|
});
|
|
@@ -110,7 +110,7 @@ $(function () {
|
|
|
110
110
|
var cfg = new Object();
|
|
111
111
|
cfg.el = el;
|
|
112
112
|
cfg.api = api;
|
|
113
|
-
cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.
|
|
113
|
+
cfg.avatar = 'https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.12/avatar/round/3442075.svg';
|
|
114
114
|
weibojs.layoutDiv(cfg);
|
|
115
115
|
}
|
|
116
116
|
});
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
// Pieter Robberechts <http://github.com/probberechts>
|
|
23
23
|
|
|
24
24
|
/*exported searchFunc*/
|
|
25
|
-
var searchFunc = function(path, filter, searchId, contentId) {
|
|
25
|
+
var searchFunc = function(path, filter, wrapperId, searchId, contentId) {
|
|
26
26
|
|
|
27
27
|
function getAllCombinations(keywords) {
|
|
28
28
|
var i, j, result = [];
|
|
@@ -43,6 +43,7 @@ var searchFunc = function(path, filter, searchId, contentId) {
|
|
|
43
43
|
var $input = document.getElementById(searchId);
|
|
44
44
|
if (!$input) { return; }
|
|
45
45
|
var $resultContent = document.getElementById(contentId);
|
|
46
|
+
var $wrapper = document.getElementById(wrapperId);
|
|
46
47
|
|
|
47
48
|
$input.addEventListener("input", function(){
|
|
48
49
|
var resultList = [];
|
|
@@ -50,8 +51,10 @@ var searchFunc = function(path, filter, searchId, contentId) {
|
|
|
50
51
|
.sort(function(a,b) { return b.split(" ").length - a.split(" ").length; });
|
|
51
52
|
$resultContent.innerHTML = "";
|
|
52
53
|
if (this.value.trim().length <= 0) {
|
|
54
|
+
$wrapper.setAttribute('searching', 'false');
|
|
53
55
|
return;
|
|
54
56
|
}
|
|
57
|
+
$wrapper.setAttribute('searching', 'true');
|
|
55
58
|
// perform local searching
|
|
56
59
|
datas.forEach(function(data) {
|
|
57
60
|
if (!data.content?.trim().length) { return }
|