hexo-theme-stellar 1.25.0 → 1.26.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 +80 -32
- package/_data/icons.yml +33 -0
- package/_data/widgets.yml +2 -16
- package/languages/zh-CN.yml +1 -1
- package/languages/zh-TW.yml +1 -1
- package/layout/404.ejs +2 -2
- package/layout/_partial/cover/index.ejs +5 -5
- package/layout/_partial/cover/post_cover.ejs +1 -1
- package/layout/_partial/cover/wiki_cover.ejs +2 -2
- package/layout/_partial/head.ejs +5 -8
- package/layout/_partial/main/article/article_footer.ejs +7 -15
- package/layout/_partial/main/article/read_next.ejs +6 -6
- package/layout/_partial/main/article/related_posts.ejs +1 -1
- package/layout/_partial/main/footer.ejs +1 -1
- package/layout/_partial/main/navbar/article_top_area.ejs +35 -0
- package/layout/_partial/main/navbar/author_banner.ejs +1 -3
- package/layout/_partial/main/navbar/breadcrumb/blog.ejs +34 -0
- package/layout/_partial/main/navbar/breadcrumb/page.ejs +10 -0
- package/layout/_partial/main/navbar/breadcrumb/wiki.ejs +20 -0
- package/layout/_partial/main/navbar/dateinfo.ejs +32 -0
- package/layout/_partial/main/navbar/ghinfo.ejs +25 -0
- package/layout/_partial/main/navbar/nav_tabs_blog.ejs +3 -3
- package/layout/_partial/main/navbar/nav_tabs_wiki.ejs +2 -2
- package/layout/_partial/main/post_list/paginator.ejs +1 -1
- package/layout/_partial/main/post_list/post_card.ejs +3 -3
- package/layout/_partial/menubtn.ejs +1 -1
- package/layout/_partial/plugins/ai/tianli_gpt.ejs +4 -3
- package/layout/_partial/plugins/comments/artalk/layout.ejs +1 -1
- package/layout/_partial/plugins/comments/artalk/script.ejs +1 -1
- package/layout/_partial/plugins/comments/beaudar/layout.ejs +1 -1
- package/layout/_partial/plugins/comments/giscus/layout.ejs +1 -1
- package/layout/_partial/plugins/comments/layout.ejs +3 -3
- package/layout/_partial/plugins/comments/twikoo/layout.ejs +1 -1
- package/layout/_partial/plugins/comments/utterances/layout.ejs +1 -1
- package/layout/_partial/plugins/comments/waline/layout.ejs +1 -1
- package/layout/_partial/sidebar/index.ejs +72 -71
- package/layout/_partial/sidebar/logo.ejs +87 -0
- package/layout/_partial/sidebar/menu.ejs +23 -18
- package/layout/_partial/sidebar/search.ejs +42 -0
- package/layout/_partial/widgets/components/link.ejs +21 -0
- package/layout/_partial/widgets/components/linklist.ejs +27 -0
- package/layout/_partial/widgets/ghissues.ejs +7 -9
- package/layout/_partial/widgets/ghrepo.ejs +10 -12
- package/layout/_partial/widgets/ghuser.ejs +2 -6
- package/layout/_partial/widgets/linklist.ejs +17 -0
- package/layout/_partial/widgets/markdown.ejs +5 -2
- package/layout/_partial/widgets/recent.ejs +12 -8
- package/layout/_partial/widgets/related.ejs +13 -9
- package/layout/_partial/widgets/search.ejs +0 -40
- package/layout/_partial/widgets/tagcloud.ejs +2 -2
- package/layout/_partial/widgets/timeline.ejs +2 -2
- package/layout/_partial/widgets/toc.ejs +24 -24
- package/layout/archive.ejs +2 -2
- package/layout/categories.ejs +1 -1
- package/layout/index.ejs +4 -20
- package/layout/index_topic.ejs +1 -1
- package/layout/index_wiki.ejs +2 -2
- package/layout/layout.ejs +53 -21
- package/layout/page.ejs +59 -12
- package/layout/tags.ejs +1 -1
- package/package.json +2 -2
- package/scripts/events/lib/config.js +28 -24
- package/scripts/events/lib/doc_tree.js +27 -19
- package/scripts/events/lib/merge_posts.js +0 -1
- package/scripts/generators/topic.js +3 -3
- package/scripts/generators/wiki.js +5 -4
- package/scripts/helpers/category_color.js +1 -1
- package/scripts/helpers/icon.js +16 -0
- package/scripts/helpers/parse_config.js +18 -16
- package/scripts/helpers/scrollreveal.js +6 -6
- package/scripts/tags/lib/toc.js +1 -1
- package/source/css/_common/blur.styl +1 -8
- package/source/css/_common/cap.styl +1 -1
- package/source/css/_common/device.styl +2 -2
- package/source/css/_common/highlight.styl +2 -2
- package/source/css/_common/layout.styl +6 -0
- package/source/css/_common/svg.styl +3 -0
- package/source/css/_custom.styl +9 -2
- package/source/css/_defines/theme.styl +10 -0
- package/source/css/_layout/layout.styl +17 -4
- package/source/css/_layout/list.styl +5 -2
- package/source/css/_layout/main.styl +5 -4
- package/source/css/_layout/md.styl +12 -11
- package/source/css/_layout/partial/paginator.styl +2 -2
- package/source/css/_layout/sidebar/footer.styl +4 -31
- package/source/css/_layout/sidebar/{header.styl → logo.styl} +11 -41
- package/source/css/_layout/sidebar/menu.styl +53 -0
- package/source/css/_layout/sidebar/nav-area.styl +2 -0
- package/source/css/_layout/{widgets → sidebar}/search.styl +51 -50
- package/source/css/_layout/sidebar/sidebar.styl +21 -31
- package/source/css/_layout/tag-plugins/banner.styl +9 -10
- package/source/css/_layout/tag-plugins/okr.styl +0 -1
- package/source/css/_layout/tag-plugins/tabs.styl +2 -2
- package/source/css/_layout/tag-plugins/toc.styl +1 -1
- package/source/css/_layout/widgets/components.styl +49 -0
- package/source/css/_layout/widgets/ghrepo.styl +0 -1
- package/source/css/_layout/widgets/ghuser.styl +0 -23
- package/source/css/_layout/widgets/list.styl +28 -0
- package/source/css/_layout/widgets/markdown.styl +20 -0
- package/source/css/_layout/widgets/related.styl +36 -5
- package/source/css/_layout/widgets/timeline.styl +21 -2
- package/source/css/_layout/widgets/toc_blog.styl +1 -1
- package/source/css/_layout/widgets/toc_common.styl +12 -12
- package/source/css/_layout/widgets/toc_wiki.styl +38 -25
- package/source/css/_layout/widgets/widgets.styl +25 -20
- package/source/css/_plugins/comments/twikoo.styl +9 -9
- package/source/css/_plugins/scrollreveal.styl +1 -1
- package/source/css/_plugins/tianli_gpt.styl +12 -14
- package/source/js/main.js +5 -2
- package/source/js/plugins/copycode.js +3 -3
- package/layout/_partial/main/header/index.ejs +0 -3
- package/layout/_partial/main/navbar/breadcrumb.ejs +0 -161
- package/layout/_partial/sidebar/header.ejs +0 -58
- package/layout/post.ejs +0 -33
- package/layout/topic.ejs +0 -28
- package/layout/wiki.ejs +0 -32
- package/source/css/_layout/widgets/recent.styl +0 -15
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<%
|
|
2
|
+
function layoutDiv() {
|
|
3
|
+
var el = ''
|
|
4
|
+
const isActive = url_for(item.url) == url_for(page.path)
|
|
5
|
+
el += `<a class="link${isActive ? ' active' : ''}" title="${item.title}" href="${item.url}">`
|
|
6
|
+
el += `<div class="flex">`
|
|
7
|
+
if (item.icon) {
|
|
8
|
+
el += icon(item.icon)
|
|
9
|
+
}
|
|
10
|
+
if (columns <= 2) {
|
|
11
|
+
el += `<span>${item.title}</span>`
|
|
12
|
+
}
|
|
13
|
+
el += `</div>`
|
|
14
|
+
if (columns == 1 && isActive) {
|
|
15
|
+
el += icon('default:bookmark.active')
|
|
16
|
+
}
|
|
17
|
+
el += `</a>`
|
|
18
|
+
return el
|
|
19
|
+
}
|
|
20
|
+
%>
|
|
21
|
+
<%- layoutDiv() %>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<%
|
|
2
|
+
function layoutDiv(linklist) {
|
|
3
|
+
var links = linklist.items || []
|
|
4
|
+
if (links.length == 0) {
|
|
5
|
+
return ''
|
|
6
|
+
}
|
|
7
|
+
var el = ''
|
|
8
|
+
var style = ''
|
|
9
|
+
var columns = linklist.columns || links.length
|
|
10
|
+
if (links.length == 1) {
|
|
11
|
+
style += `style="grid-template-columns:repeat(1,1fr);"`
|
|
12
|
+
} else {
|
|
13
|
+
style += `style="grid-template-columns:repeat(${columns},1fr);"`
|
|
14
|
+
}
|
|
15
|
+
var align = 'center'
|
|
16
|
+
if (columns == 1 && links.length > 1) {
|
|
17
|
+
align = 'left'
|
|
18
|
+
}
|
|
19
|
+
el += `<div class="linklist ${align}" ${style}>`
|
|
20
|
+
for (let link of links) {
|
|
21
|
+
el += partial('link', {item: link, columns: columns})
|
|
22
|
+
}
|
|
23
|
+
el += `</div>`
|
|
24
|
+
return el
|
|
25
|
+
}
|
|
26
|
+
%>
|
|
27
|
+
<%- layoutDiv(item) %>
|
|
@@ -5,13 +5,11 @@ function layoutDiv() {
|
|
|
5
5
|
var branch = 'main';
|
|
6
6
|
if (page.repo) {
|
|
7
7
|
repo = page.repo
|
|
8
|
-
} else if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
branch = proj.branch;
|
|
14
|
-
}
|
|
8
|
+
} else if (theme.wiki.tree[page.wiki]?.repo) {
|
|
9
|
+
const proj = theme.wiki.tree[page.wiki]
|
|
10
|
+
repo = proj.repo
|
|
11
|
+
if (proj.branch != undefined) {
|
|
12
|
+
branch = proj.branch
|
|
15
13
|
}
|
|
16
14
|
}
|
|
17
15
|
if (repo == undefined) {
|
|
@@ -21,9 +19,9 @@ function layoutDiv() {
|
|
|
21
19
|
if (item.labels) {
|
|
22
20
|
item.api += '&labels=' + item.labels;
|
|
23
21
|
}
|
|
24
|
-
el +=
|
|
22
|
+
el += `<widget class="widget-wrapper${scrollreveal(' ')} timeline">`
|
|
25
23
|
if (item.title) {
|
|
26
|
-
el += '<div class="widget-header
|
|
24
|
+
el += '<div class="widget-header dis-select">';
|
|
27
25
|
el += '<span class="name">' + item.title + '</span>';
|
|
28
26
|
el += '</div>';
|
|
29
27
|
}
|
|
@@ -5,40 +5,38 @@ function layoutDiv() {
|
|
|
5
5
|
var branch = 'main';
|
|
6
6
|
if (page.repo) {
|
|
7
7
|
repo = page.repo
|
|
8
|
-
} else if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
branch = proj.branch;
|
|
14
|
-
}
|
|
8
|
+
} else if (theme.wiki.tree[page.wiki]?.repo) {
|
|
9
|
+
const proj = theme.wiki.tree[page.wiki]
|
|
10
|
+
repo = proj.repo
|
|
11
|
+
if (proj.branch != undefined) {
|
|
12
|
+
branch = proj.branch
|
|
15
13
|
}
|
|
16
14
|
}
|
|
17
15
|
if (repo == undefined) {
|
|
18
16
|
return el;
|
|
19
17
|
}
|
|
20
18
|
// 布局
|
|
21
|
-
el +=
|
|
19
|
+
el += `<widget class="widget-wrapper${scrollreveal(' ')} ghrepo">`
|
|
22
20
|
// body
|
|
23
21
|
el += '<div class="widget-body">';
|
|
24
22
|
el += '<div class="items stellar-ghinfo-api" api="' + theme.api_host.ghapi + '/repos/' + repo + '">';
|
|
25
23
|
el += '<a class="repo" href="https://github.com/' + repo + '" target="_blank" rel="external nofollow noopener noreferrer">';
|
|
26
24
|
el += '<div class="repo-name flex-row">';
|
|
27
|
-
el += '
|
|
25
|
+
el += icon('github:repo')
|
|
28
26
|
el += repo;
|
|
29
27
|
el += '</div>';
|
|
30
28
|
el += '<div class="repo-desc"><span type="text" id="description"> </span></div>';
|
|
31
29
|
el += '<div class="grid">';
|
|
32
30
|
el += '<div class="flex-row">';
|
|
33
|
-
el += '
|
|
31
|
+
el += icon('github:star')
|
|
34
32
|
el += '<span type="text" id="stargazers_count"></span>';
|
|
35
33
|
el += '</div>';
|
|
36
34
|
el += '<div class="flex-row">';
|
|
37
|
-
el += '
|
|
35
|
+
el += icon('github:fork')
|
|
38
36
|
el += '<span type="text" id="forks_count"></span>';
|
|
39
37
|
el += '</div>';
|
|
40
38
|
el += '<div class="flex-row stellar-ghinfo-api" index="0" api="' + theme.api_host.ghapi + '/repos/' + repo + '/tags">';
|
|
41
|
-
el += '
|
|
39
|
+
el += icon('github:tag')
|
|
42
40
|
el += '<span type="text" id="latest-tag-name">0</span>';
|
|
43
41
|
el += '</div>';
|
|
44
42
|
el += '</div>';
|
|
@@ -22,7 +22,7 @@ function layoutDiv() {
|
|
|
22
22
|
return el;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
el +=
|
|
25
|
+
el += `<widget class="widget-wrapper${scrollreveal(' ')} ghuser">`
|
|
26
26
|
// body
|
|
27
27
|
el += '<div class="widget-body stellar-ghinfo-api" api="' + theme.api_host.ghapi + '/users/' + item.username + '">';
|
|
28
28
|
if (item.avatar) {
|
|
@@ -42,13 +42,9 @@ function layoutDiv() {
|
|
|
42
42
|
el += '</div>';
|
|
43
43
|
// follow
|
|
44
44
|
el += '<a class="follow" href="https://github.com/' + item.username + '">';
|
|
45
|
-
el += '
|
|
45
|
+
el += icon('github:logo')
|
|
46
46
|
el += 'Follow';
|
|
47
47
|
el += '</a>';
|
|
48
|
-
// menu
|
|
49
|
-
if (item.menu) {
|
|
50
|
-
el += partial('../sidebar/menu', {where: 'sidebar'});
|
|
51
|
-
}
|
|
52
48
|
el += '</div>';
|
|
53
49
|
el += '</widget>';
|
|
54
50
|
return el;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<%
|
|
2
|
+
function layoutDiv() {
|
|
3
|
+
var el = '';
|
|
4
|
+
el += `<widget class="widget-wrapper${scrollreveal(' ')} linklist">`
|
|
5
|
+
if (item.title?.length > 0) {
|
|
6
|
+
el += '<div class="widget-header dis-select">';
|
|
7
|
+
el += '<span class="name">' + item.title + '</span>';
|
|
8
|
+
el += '</div>';
|
|
9
|
+
}
|
|
10
|
+
el += '<div class="widget-body fs14">';
|
|
11
|
+
el += partial('components/linklist', {item: item})
|
|
12
|
+
el += '</div>';
|
|
13
|
+
el += '</widget>';
|
|
14
|
+
return el;
|
|
15
|
+
}
|
|
16
|
+
%>
|
|
17
|
+
<%- layoutDiv() %>
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
function layoutDiv() {
|
|
3
3
|
if (!item.content?.length && !item.src?.length) return ''
|
|
4
4
|
var el = '';
|
|
5
|
-
el +=
|
|
5
|
+
el += `<widget class="widget-wrapper${scrollreveal(' ')} markdown">`
|
|
6
6
|
if (item.title?.length > 0) {
|
|
7
|
-
el += '<div class="widget-header
|
|
7
|
+
el += '<div class="widget-header dis-select">';
|
|
8
8
|
el += '<span class="name">' + item.title + '</span>';
|
|
9
9
|
el += '</div>';
|
|
10
10
|
}
|
|
@@ -15,6 +15,9 @@ function layoutDiv() {
|
|
|
15
15
|
if (item.src) {
|
|
16
16
|
el += `<div class="stellar-marked-api md-marked" src="${item.src}"></div>`
|
|
17
17
|
}
|
|
18
|
+
if (item.linklist) {
|
|
19
|
+
el += partial('components/linklist', {item: item.linklist})
|
|
20
|
+
}
|
|
18
21
|
el += '</div>';
|
|
19
22
|
el += '</widget>';
|
|
20
23
|
return el;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<%
|
|
2
2
|
function layoutDiv() {
|
|
3
|
-
var el =
|
|
3
|
+
var el = `<widget class="widget-wrapper${scrollreveal(' ')} post-list">`
|
|
4
4
|
// header
|
|
5
|
-
el += '<div class="widget-header
|
|
5
|
+
el += '<div class="widget-header dis-select">';
|
|
6
6
|
el += '<span class="name">' + __("meta.recent_update") + '</span>';
|
|
7
7
|
if (item.rss) {
|
|
8
8
|
el += '<a class="cap-action" id="rss" title="Subscribe" href="' + item.rss + '">';
|
|
9
|
-
el +=
|
|
9
|
+
el += icon('default:rss')
|
|
10
10
|
el += '</a>';
|
|
11
11
|
}
|
|
12
12
|
el += '</div>';
|
|
@@ -25,20 +25,24 @@ function layoutDiv() {
|
|
|
25
25
|
arr = site.posts.filter( p => p.title && p.title.length > 0)
|
|
26
26
|
arr = arr.sort("updated", -1)
|
|
27
27
|
}
|
|
28
|
-
el += '<div class="widget-body
|
|
28
|
+
el += '<div class="widget-body fs14">';
|
|
29
29
|
arr.length = item.limit
|
|
30
30
|
arr.forEach(post => {
|
|
31
31
|
if (!post) { return }
|
|
32
|
-
|
|
32
|
+
const isActive = post.path == page.path
|
|
33
|
+
el += `<a class="item title${post.path == page.path ? ' active' : ''}" href="${url_for(post.link || post.path)}">`
|
|
33
34
|
el += '<span class="title">'
|
|
34
|
-
if (post.
|
|
35
|
-
|
|
35
|
+
if (post.wiki) {
|
|
36
|
+
const proj = theme.wiki.tree[post.wiki];
|
|
36
37
|
let name = proj?.name || post?.wiki;
|
|
37
38
|
if (name) {
|
|
38
39
|
el += '<strong>' + name + '</strong>' + '<span class="dot"></span>';
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
|
-
el += (post.title || post.
|
|
42
|
+
el += (post.title || post.wiki) + '</span>';
|
|
43
|
+
if (isActive) {
|
|
44
|
+
el += icon('default:bookmark.active')
|
|
45
|
+
}
|
|
42
46
|
el += '</a>';
|
|
43
47
|
el += '';
|
|
44
48
|
});
|
|
@@ -8,14 +8,18 @@ function relatedPostsInTopic() {
|
|
|
8
8
|
return ''
|
|
9
9
|
}
|
|
10
10
|
var el = ''
|
|
11
|
-
el += `<widget class="widget-wrapper
|
|
12
|
-
el += `<div class="widget-header
|
|
11
|
+
el += `<widget class="widget-wrapper${scrollreveal(' ')} post-list">`
|
|
12
|
+
el += `<div class="widget-header dis-select">`
|
|
13
13
|
el += `<span class="name">${__('btn.topic') + __('symbol.colon') + topic.name}</span>`
|
|
14
14
|
el += `</div>`
|
|
15
|
-
el += `<div class="widget-body
|
|
15
|
+
el += `<div class="widget-body">`
|
|
16
16
|
for (let post of topic.pages) {
|
|
17
|
-
|
|
17
|
+
const isActive = post.path == page.path
|
|
18
|
+
el += `<a class="item${isActive ? ' active' : ''}" href="${url_for(post.path)}">`
|
|
18
19
|
el += `<span class="title">${post.title}</span>`
|
|
20
|
+
if (isActive) {
|
|
21
|
+
el += icon('default:bookmark.active')
|
|
22
|
+
}
|
|
19
23
|
el += `</a>`
|
|
20
24
|
}
|
|
21
25
|
el += `</div>`
|
|
@@ -30,11 +34,11 @@ function relatedWiki() {
|
|
|
30
34
|
const relatedItems = thisItemObject.relatedItems
|
|
31
35
|
var el = ''
|
|
32
36
|
for (let relatedItem of relatedItems) {
|
|
33
|
-
el += `<widget class="widget-wrapper
|
|
34
|
-
el += `<div class="widget-header
|
|
37
|
+
el += `<widget class="widget-wrapper${scrollreveal(' ')} post-card">`
|
|
38
|
+
el += `<div class="widget-header dis-select">`
|
|
35
39
|
el += `<span class="name">${__('meta.more') + __('symbol.colon') + relatedItem.name}</span>`
|
|
36
40
|
el += `</div>`
|
|
37
|
-
el += `<div class="widget-body
|
|
41
|
+
el += `<div class="widget-body">`
|
|
38
42
|
for (let id of relatedItem.items) {
|
|
39
43
|
// 同一个分组中的其它项目
|
|
40
44
|
let item = theme.wiki.tree[id]
|
|
@@ -51,9 +55,9 @@ function relatedWiki() {
|
|
|
51
55
|
return el
|
|
52
56
|
}
|
|
53
57
|
function layoutDiv() {
|
|
54
|
-
if (page.
|
|
58
|
+
if (page.wiki?.length > 0) {
|
|
55
59
|
return relatedWiki()
|
|
56
|
-
} else if (page.
|
|
60
|
+
} else if (page.topic?.length > 0) {
|
|
57
61
|
return relatedPostsInTopic()
|
|
58
62
|
}
|
|
59
63
|
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
function layoutDiv() {
|
|
3
|
-
var el = '<widget class="widget-wrapper search">'
|
|
4
|
-
el += '<div class="widget-body">'
|
|
5
|
-
el += '<div class="search-wrapper" id="search-wrapper">'
|
|
6
|
-
el += '<form class="search-form">'
|
|
7
|
-
var filter = ''
|
|
8
|
-
if (item.filter == 'auto') {
|
|
9
|
-
if (page.layout == 'wiki') {
|
|
10
|
-
let matches = page.path.match(/(.*?)\/(.*?)\//i)
|
|
11
|
-
if (matches?.length > 0) {
|
|
12
|
-
filter = matches[0]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
} else {
|
|
16
|
-
if (item.filter?.length > 0) {
|
|
17
|
-
filter = item.filter
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
el += '<input type="text" class="search-input" id="search-input"'
|
|
21
|
-
if (filter.length > 0) {
|
|
22
|
-
if (!filter.startsWith('/')) {
|
|
23
|
-
filter = '/' + filter
|
|
24
|
-
}
|
|
25
|
-
el += ' data-filter="' + filter + '"'
|
|
26
|
-
el += ' placeholder="' + (item.placeholder || __('search.search_in', filter)) + '">'
|
|
27
|
-
} else {
|
|
28
|
-
el += ' placeholder="' + (item.placeholder || __('search.search')) + '">'
|
|
29
|
-
}
|
|
30
|
-
el += '<svg t="1705074644177" class="icon search-icon" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1560" width="200" height="200"><path d="M1008.839137 935.96571L792.364903 719.491476a56.783488 56.783488 0 0 0-80.152866 0 358.53545 358.53545 0 1 1 100.857314-335.166073 362.840335 362.840335 0 0 1-3.689902 170.145468 51.248635 51.248635 0 1 0 99.217358 26.444296 462.057693 462.057693 0 1 0-158.255785 242.303546l185.930047 185.725053a51.248635 51.248635 0 0 0 72.568068 0 51.248635 51.248635 0 0 0 0-72.978056z" p-id="1561"></path><path d="M616.479587 615.969233a50.428657 50.428657 0 0 0-61.498362-5.534852 174.655348 174.655348 0 0 1-177.525271 3.484907 49.403684 49.403684 0 0 0-58.833433 6.76482l-3.074918 2.869923a49.403684 49.403684 0 0 0 8.609771 78.10292 277.767601 277.767601 0 0 0 286.992355-5.739847 49.403684 49.403684 0 0 0 8.404776-76.667958z" p-id="1562"></path></svg>'
|
|
31
|
-
el += '</form>'
|
|
32
|
-
el += '<div id="search-result"></div>'
|
|
33
|
-
el += '<div class="search-no-result">' + __('search.no_results') + '</div>'
|
|
34
|
-
el += '</div>'
|
|
35
|
-
el += '</div>'
|
|
36
|
-
el += '</widget>'
|
|
37
|
-
return el
|
|
38
|
-
}
|
|
39
|
-
%>
|
|
40
|
-
<%- layoutDiv() %>
|
|
@@ -8,9 +8,9 @@ function layoutDiv() {
|
|
|
8
8
|
delete opts['title'];
|
|
9
9
|
delete opts['layout'];
|
|
10
10
|
opts.class = 'tag ';
|
|
11
|
-
el +=
|
|
11
|
+
el += `<widget class="widget-wrapper${scrollreveal(' ')} tagcloud">`
|
|
12
12
|
if (item.title) {
|
|
13
|
-
el += '<div class="widget-header
|
|
13
|
+
el += '<div class="widget-header dis-select">';
|
|
14
14
|
el += '<span class="name">' + item.title + '</span>';
|
|
15
15
|
el += '</div>';
|
|
16
16
|
}
|
|
@@ -4,9 +4,9 @@ function layoutDiv() {
|
|
|
4
4
|
if (item.api == undefined) {
|
|
5
5
|
return el;
|
|
6
6
|
}
|
|
7
|
-
el +=
|
|
7
|
+
el += `<widget class="widget-wrapper${scrollreveal(' ')} timeline">`
|
|
8
8
|
if (item.title) {
|
|
9
|
-
el += '<div class="widget-header
|
|
9
|
+
el += '<div class="widget-header dis-select">';
|
|
10
10
|
el += '<span class="name">' + item.title + '</span>';
|
|
11
11
|
el += '</div>';
|
|
12
12
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%
|
|
2
|
-
|
|
2
|
+
const proj = theme.wiki.tree[page.wiki]
|
|
3
3
|
var hasTOC = true
|
|
4
4
|
function layoutTocBody() {
|
|
5
5
|
if (toc(page.content).length > 0) {
|
|
@@ -16,7 +16,7 @@ function layoutTocBody() {
|
|
|
16
16
|
|
|
17
17
|
function layoutTocHeader(title) {
|
|
18
18
|
var el = ''
|
|
19
|
-
el += `<div class="widget-header
|
|
19
|
+
el += `<div class="widget-header dis-select">`
|
|
20
20
|
el += `<span class="name">${title || __("meta.toc")}</span>`
|
|
21
21
|
el += `</div>`
|
|
22
22
|
return el
|
|
@@ -40,6 +40,9 @@ function layoutDocTree(pages) {
|
|
|
40
40
|
}
|
|
41
41
|
el += `<a class="doc-tree-link${isActive}" href="${href}">`
|
|
42
42
|
el += `<span class="toc-text">${p.title}</span>`
|
|
43
|
+
if (isActive.length > 0) {
|
|
44
|
+
el += icon('default:bookmark.active')
|
|
45
|
+
}
|
|
43
46
|
el += `</a>`
|
|
44
47
|
}
|
|
45
48
|
if (p.path === page.path) {
|
|
@@ -53,12 +56,8 @@ function layoutDocTree(pages) {
|
|
|
53
56
|
|
|
54
57
|
function layoutDiv(fallback) {
|
|
55
58
|
var type = ''
|
|
56
|
-
if (proj
|
|
57
|
-
|
|
58
|
-
type = 'multi'
|
|
59
|
-
} else {
|
|
60
|
-
type = 'single'
|
|
61
|
-
}
|
|
59
|
+
if (proj?.pages) {
|
|
60
|
+
type = proj.pages.length > 1 ? 'multi' : 'single'
|
|
62
61
|
} else {
|
|
63
62
|
let toc_content = toc(page.content)
|
|
64
63
|
if (toc_content && toc_content.length > 0) {
|
|
@@ -68,19 +67,8 @@ function layoutDiv(fallback) {
|
|
|
68
67
|
|
|
69
68
|
var el = ''
|
|
70
69
|
if (type.length > 0) {
|
|
71
|
-
el += `<widget class="widget-wrapper toc ${type}" id="data-toc" collapse="${item.collapse}">`
|
|
72
|
-
if (
|
|
73
|
-
// post 布局
|
|
74
|
-
el += layoutTocHeader(page.toc_title)
|
|
75
|
-
el += `<div class="widget-body fs14">`
|
|
76
|
-
el += `<div class="doc-tree active">`
|
|
77
|
-
el += layoutTocBody()
|
|
78
|
-
el += `</div>`
|
|
79
|
-
el += `</div>`
|
|
80
|
-
if (hasTOC == false) {
|
|
81
|
-
return ''
|
|
82
|
-
}
|
|
83
|
-
} else if (proj) {
|
|
70
|
+
el += `<widget class="widget-wrapper${scrollreveal(' ')} toc ${type}" id="data-toc" collapse="${item.collapse}">`
|
|
71
|
+
if (proj) {
|
|
84
72
|
// wiki 布局
|
|
85
73
|
if (proj.sections && proj.sections.length > 0 && proj.pages.length > 1) { // 多 pages
|
|
86
74
|
for (let sec of proj.sections) {
|
|
@@ -96,7 +84,7 @@ function layoutDiv(fallback) {
|
|
|
96
84
|
}
|
|
97
85
|
} else { // 单 page
|
|
98
86
|
if (proj.pages.length == 1) {
|
|
99
|
-
el += layoutTocHeader(
|
|
87
|
+
el += layoutTocHeader()
|
|
100
88
|
}
|
|
101
89
|
el += `<div class="widget-body fs14">`
|
|
102
90
|
el += layoutDocTree(proj.pages)
|
|
@@ -105,10 +93,22 @@ function layoutDiv(fallback) {
|
|
|
105
93
|
return ''
|
|
106
94
|
}
|
|
107
95
|
}
|
|
108
|
-
}
|
|
96
|
+
} else {
|
|
97
|
+
// post 布局
|
|
98
|
+
el += layoutTocHeader()
|
|
99
|
+
el += `<div class="widget-body fs14">`
|
|
100
|
+
el += `<div class="doc-tree active">`
|
|
101
|
+
el += layoutTocBody()
|
|
102
|
+
el += `</div>`
|
|
103
|
+
el += `</div>`
|
|
104
|
+
if (hasTOC == false) {
|
|
105
|
+
return ''
|
|
106
|
+
}
|
|
107
|
+
}
|
|
109
108
|
el += `</widget>`
|
|
110
109
|
} else if (item.fallback) {
|
|
111
|
-
|
|
110
|
+
const fallback = theme.widgets[item.fallback]
|
|
111
|
+
el += partial(fallback.layout, {item: fallback})
|
|
112
112
|
}
|
|
113
113
|
return el
|
|
114
114
|
}
|
package/layout/archive.ejs
CHANGED
|
@@ -4,7 +4,7 @@ if (page.menu_id == undefined) {
|
|
|
4
4
|
page.menu_id = 'post';
|
|
5
5
|
}
|
|
6
6
|
if (page.author) {
|
|
7
|
-
page.header =
|
|
7
|
+
page.header = false;
|
|
8
8
|
}
|
|
9
9
|
function layoutArchiveList() {
|
|
10
10
|
var el = ''
|
|
@@ -24,7 +24,7 @@ function layoutArchiveList() {
|
|
|
24
24
|
}
|
|
25
25
|
})
|
|
26
26
|
for (let year of years) {
|
|
27
|
-
el += `<article class="${scrollreveal()}" id="archive">`
|
|
27
|
+
el += `<article class="${scrollreveal('')}" id="archive">`
|
|
28
28
|
el += `<div class='archive-header h4'>${year}</div>`
|
|
29
29
|
site.posts.sort('date', -1).filter(function (post) {
|
|
30
30
|
post.year = date(post.date, 'YYYY')
|
package/layout/categories.ejs
CHANGED
|
@@ -9,7 +9,7 @@ if (page.menu_id == undefined) {
|
|
|
9
9
|
<% page.layout = 'categories'; %>
|
|
10
10
|
<%- partial('_partial/main/navbar/nav_tabs_blog') %>
|
|
11
11
|
<div class='post-list'>
|
|
12
|
-
<article class='<%- scrollreveal() %>' id='cats'>
|
|
12
|
+
<article class='<%- scrollreveal("") %>' id='cats'>
|
|
13
13
|
<% site.categories.sort('path').each(function(category){ %>
|
|
14
14
|
<div>
|
|
15
15
|
<a class="<%= category.parent ? 'cat child' : 'cat'%>" href="<%= url_for(category.path) %>">
|
package/layout/index.ejs
CHANGED
|
@@ -12,7 +12,7 @@ function layout_post_card(layout, post, content) {
|
|
|
12
12
|
if (layout == 'post' && post.cover != undefined && post.poster != undefined) {
|
|
13
13
|
layout += ' photo';
|
|
14
14
|
}
|
|
15
|
-
el +=
|
|
15
|
+
el += `<a class="post-card${scrollreveal(' ')} ${layout}" href="${url_for(post.link || post.path)}">`
|
|
16
16
|
el += content;
|
|
17
17
|
el += '</a>';
|
|
18
18
|
return el;
|
|
@@ -21,25 +21,9 @@ function layout_post_card(layout, post, content) {
|
|
|
21
21
|
function layout_post_list(partial) {
|
|
22
22
|
var el = '';
|
|
23
23
|
el += '<div class="post-list post">';
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var pinned = site.posts.filter(post => post.pin != undefined).sort((config.index_generator && config.index_generator.order_by) || '-date');
|
|
28
|
-
pinned.forEach((post, i) => {
|
|
29
|
-
el += layout_post_card('post', post, partial(post));
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
// unpinned posts
|
|
33
|
-
page.posts.each(function(post){
|
|
34
|
-
if (post.pin == undefined) {
|
|
35
|
-
el += layout_post_card('post', post, partial(post));
|
|
36
|
-
}
|
|
37
|
-
})
|
|
38
|
-
} else {
|
|
39
|
-
page.posts.each(function(post){
|
|
40
|
-
el += layout_post_card('post', post, partial(post));
|
|
41
|
-
})
|
|
42
|
-
}
|
|
24
|
+
page.posts.each(function(post){
|
|
25
|
+
el += layout_post_card('post', post, partial(post));
|
|
26
|
+
})
|
|
43
27
|
el += '</div>';
|
|
44
28
|
return el;
|
|
45
29
|
}
|
package/layout/index_topic.ejs
CHANGED
|
@@ -8,7 +8,7 @@ function layout_topic_list(partial) {
|
|
|
8
8
|
continue
|
|
9
9
|
}
|
|
10
10
|
el += `<div class="post-list wiki topic">`
|
|
11
|
-
el += `<a class="post-card wiki topic
|
|
11
|
+
el += `<a class="post-card wiki topic${scrollreveal(' ')}" href="${url_for(topic.homepage?.path || '/')}">`
|
|
12
12
|
el += partial(topic)
|
|
13
13
|
el += `</a>`
|
|
14
14
|
el += `</div>`
|
package/layout/index_wiki.ejs
CHANGED
|
@@ -13,14 +13,14 @@ function layout_wiki_list(partial) {
|
|
|
13
13
|
if (page.filter === false) {
|
|
14
14
|
// wikiList
|
|
15
15
|
el += `<div class="post-list wiki">`
|
|
16
|
-
el += `<a class="post-card wiki
|
|
16
|
+
el += `<a class="post-card wiki${scrollreveal(' ')}" href="${url_for(proj.homepage?.path || '/')}">`
|
|
17
17
|
el += partial(proj)
|
|
18
18
|
el += `</a>`
|
|
19
19
|
el += `</div>`
|
|
20
20
|
} else if (proj.tags && proj.tags.includes(page.tagName) === true) {
|
|
21
21
|
// filtered wikiList
|
|
22
22
|
el += `<div class="post-list wiki filter">`
|
|
23
|
-
el += `<a class="post-card wiki
|
|
23
|
+
el += `<a class="post-card wiki${scrollreveal(' ')}" href="${url_for(proj.homepage?.path || '/')}">`
|
|
24
24
|
el += partial(proj)
|
|
25
25
|
el += `</a>`
|
|
26
26
|
el += `</div>`
|
package/layout/layout.ejs
CHANGED
|
@@ -1,21 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
<%
|
|
2
|
+
// 页面类型:索引页面还是内容页面
|
|
3
|
+
var page_type = 'index'
|
|
4
|
+
if (['post', 'page', 'wiki', null].includes(page.layout)) {
|
|
5
|
+
if (!page.nav_tabs) {
|
|
6
|
+
page_type = 'content'
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
// 文章类型:技术类文章/文学类文章
|
|
10
|
+
var article_type = theme.article.type
|
|
11
|
+
if (page.type?.length > 0) {
|
|
12
|
+
article_type = page.type
|
|
13
|
+
}
|
|
14
|
+
// 是否缩进
|
|
15
|
+
var indent = false
|
|
16
|
+
if (page.indent != null) {
|
|
17
|
+
indent = page.indent
|
|
18
|
+
} else if (theme.topic.tree[page.topic]?.indent != null) {
|
|
19
|
+
indent = theme.topic.tree[page.topic]?.indent
|
|
20
|
+
} else if (theme.wiki.tree[page.wiki]?.indent != null) {
|
|
21
|
+
indent = theme.wiki.tree[page.wiki]?.indent
|
|
22
|
+
} else if (theme.article.indent != null) {
|
|
23
|
+
indent = theme.article.indent
|
|
24
|
+
} else {
|
|
25
|
+
indent = article_type === 'story'
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var html = `<!DOCTYPE html>`
|
|
29
|
+
html += `<html lang="${page.lang}">`
|
|
30
|
+
html += partial('_partial/head')
|
|
31
|
+
html += `<body>`
|
|
32
|
+
html += partial('_partial/cover/index')
|
|
33
|
+
html += `<div class="l_body ${page_type} ${article_type}" id="start" layout="${page.layout}" ${indent ? 'text-indent' : ''}>`
|
|
34
|
+
html += `<aside class="l_left">`
|
|
35
|
+
html += `<div class="sidebar-container${theme.style.sidebar?.blur ? ' sidebar-blur' : ''}">`
|
|
36
|
+
html += partial('_partial/sidebar/index')
|
|
37
|
+
html += `</div>`
|
|
38
|
+
html += `</aside>`
|
|
39
|
+
html += `<div class="l_main" id="main">`
|
|
40
|
+
html += partial('_partial/sidebar/logo', {where: 'main'})
|
|
41
|
+
html += body
|
|
42
|
+
html += partial('_partial/main/footer')
|
|
43
|
+
html += partial('_partial/menubtn')
|
|
44
|
+
html += `<div class="main-mask" onclick="sidebar.toggle()"></div>`
|
|
45
|
+
html += `</div>`
|
|
46
|
+
html += `</div>`
|
|
47
|
+
html += `<div class="scripts">`
|
|
48
|
+
html += partial('_partial/scripts/index')
|
|
49
|
+
html += `</div>`
|
|
50
|
+
html += `</body>`
|
|
51
|
+
html += `</html>`
|
|
52
|
+
%>
|
|
53
|
+
<%- html %>
|