hexo-theme-stellar 1.19.0 → 1.21.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/README.md +3 -3
- package/_config.yml +49 -22
- package/languages/zh-CN.yml +1 -1
- package/languages/zh-TW.yml +1 -1
- package/layout/404.ejs +1 -1
- package/layout/_partial/cover/wiki_cover.ejs +10 -16
- package/layout/_partial/head.ejs +3 -3
- package/layout/_partial/main/article/article_footer.ejs +86 -54
- package/layout/_partial/main/article/read_next.ejs +17 -12
- package/layout/_partial/main/navbar/breadcrumb.ejs +55 -17
- package/layout/_partial/main/navbar/list_post.ejs +6 -4
- package/layout/_partial/main/navbar/list_wiki.ejs +4 -3
- package/layout/_partial/main/post_list/post_card.ejs +1 -1
- package/layout/_partial/main/post_list/wiki_card.ejs +6 -11
- package/layout/_partial/{main/article/ai_abstract.ejs → plugins/ai/tianli_gpt.ejs} +3 -2
- package/layout/_partial/plugins/comments/beaudar/script.ejs +1 -1
- package/layout/_partial/plugins/comments/giscus/script.ejs +1 -1
- package/layout/_partial/plugins/comments/layout.ejs +2 -2
- package/layout/_partial/plugins/comments/utterances/script.ejs +1 -1
- package/layout/_partial/sidebar/header.ejs +1 -1
- package/layout/_partial/sidebar/index.ejs +4 -4
- package/layout/_partial/widgets/ghissues.ejs +1 -1
- package/layout/_partial/widgets/ghrepo.ejs +1 -1
- package/layout/_partial/widgets/ghuser.ejs +1 -1
- package/layout/_partial/widgets/recent.ejs +3 -3
- package/layout/_partial/widgets/related.ejs +13 -21
- package/layout/_partial/widgets/toc.ejs +20 -12
- package/layout/index.ejs +13 -11
- package/layout/mermaid.ejs +8 -4
- package/layout/page.ejs +3 -0
- package/layout/post.ejs +1 -1
- package/layout/wiki.ejs +4 -1
- package/package.json +1 -1
- package/scripts/events/lib/doc_tree.js +142 -97
- package/scripts/filters/index.js +4 -1
- package/scripts/helpers/category_color.js +18 -5
- package/scripts/tags/index.js +5 -3
- package/scripts/tags/inline-labels.js +2 -2
- package/scripts/tags/lib/banner.js +68 -0
- package/scripts/tags/lib/{ablock.js → box.js} +4 -4
- package/scripts/tags/lib/checkbox.js +1 -1
- package/scripts/tags/lib/folders.js +1 -1
- package/scripts/tags/lib/folding.js +1 -1
- package/scripts/tags/lib/gallery.js +51 -0
- package/scripts/tags/lib/hashtag.js +36 -0
- package/scripts/tags/lib/image.js +5 -1
- package/scripts/tags/lib/mark.js +1 -1
- package/scripts/tags/lib/navbar.js +15 -34
- package/scripts/tags/lib/note.js +1 -1
- package/scripts/tags/lib/okr.js +140 -0
- package/scripts/tags/lib/swiper.js +1 -1
- package/scripts/tags/lib/timeline.js +3 -3
- package/scripts/tags/lib/toc.js +1 -1
- package/source/css/_common/highlight.styl +3 -0
- package/source/css/_custom.styl +2 -2
- package/source/css/_defines/theme.styl +0 -1
- package/source/css/_layout/list.styl +12 -4
- package/source/css/_layout/md.styl +11 -8
- package/source/css/_layout/partial/bread-nav.styl +32 -0
- package/source/css/_layout/partial/cover.styl +2 -0
- package/source/css/_layout/partial/paginator.styl +9 -5
- package/source/css/_layout/tag-plugins/banner.styl +106 -0
- package/source/css/_layout/tag-plugins/common.styl +33 -39
- package/source/css/_layout/tag-plugins/folding.styl +1 -1
- package/source/css/_layout/tag-plugins/frame.styl +1 -1
- package/source/css/_layout/tag-plugins/gallery.styl +46 -0
- package/source/css/_layout/tag-plugins/grid.styl +0 -9
- package/source/css/_layout/tag-plugins/hashtag.styl +17 -0
- package/source/css/_layout/tag-plugins/mark.styl +2 -5
- package/source/css/_layout/tag-plugins/note.styl +2 -1
- package/source/css/_layout/tag-plugins/okr.styl +106 -0
- package/source/css/_layout/tag-plugins/timeline.styl +14 -1
- package/source/css/_layout/widgets/ghuser.styl +5 -6
- package/source/css/_plugins/copycode.styl +17 -6
- package/source/css/_plugins/fancybox.styl +4 -0
- package/source/css/_plugins/index.styl +2 -0
- package/source/css/_plugins/mermaid.styl +125 -10
- package/source/css/{_layout/partial/ai_abstract.styl → _plugins/tianli_gpt.styl} +2 -2
- package/source/js/main.js +25 -3
- package/source/js/plugins/copycode.js +1 -7
- package/source/js/plugins/fcircle.js +3 -3
- package/source/js/plugins/friends.js +3 -3
- package/source/js/plugins/linkcard.js +1 -1
- package/source/js/plugins/memos.js +133 -0
- package/source/js/plugins/sites.js +4 -4
- package/source/js/plugins/timeline.js +3 -3
- package/source/js/plugins/weibo.js +3 -3
- package/scripts/tags/lib/tag.js +0 -35
- package/source/css/_layout/tag-plugins/tag.styl +0 -13
|
@@ -11,9 +11,10 @@ function layoutDiv() {
|
|
|
11
11
|
el += ' href="' + url_for(config.wiki_dir || "/wiki/") + '">' + __("btn.all_wiki") + '</a>';
|
|
12
12
|
el += '</a>';
|
|
13
13
|
// 项目分类
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let
|
|
14
|
+
const { shelf, all_tags } = theme.wiki;
|
|
15
|
+
for (let id of Object.keys(all_tags)) {
|
|
16
|
+
let tag = all_tags[id];
|
|
17
|
+
let projects = tag.items.filter(item => shelf.includes(item))
|
|
17
18
|
if (projects && projects.length > 0) {
|
|
18
19
|
el += '<a';
|
|
19
20
|
if (tag.name && tag.name.length > 0 && page.tagName === tag.name) {
|
|
@@ -90,7 +90,7 @@ function div_default() {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
if (post.pin) {
|
|
93
|
-
el += '<span class="pin"><img src="https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.
|
|
93
|
+
el += '<span class="pin"><img src="https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.9/badge/3279dd441df8b.svg"/></span>';
|
|
94
94
|
}
|
|
95
95
|
el += '</div>';
|
|
96
96
|
el += '</article>';
|
|
@@ -2,19 +2,14 @@
|
|
|
2
2
|
function layoutDiv() {
|
|
3
3
|
var el = '';
|
|
4
4
|
el += '<article class="md-text">';
|
|
5
|
-
|
|
6
|
-
el += '<div class="preview">';
|
|
7
|
-
el += '<img src="' + proj.logo.src + '" alt="logo"';
|
|
8
|
-
if (proj.logo.small) {
|
|
9
|
-
el += ' height="' + proj.logo.small + '"';
|
|
10
|
-
}
|
|
11
|
-
el += '/>';
|
|
12
|
-
el += '</div>';
|
|
13
|
-
}
|
|
5
|
+
el += `<div class="preview"><img src="${proj.icon ? proj.icon : theme.default.project}"/></div>`
|
|
14
6
|
el += '<div class="excerpt">';
|
|
15
7
|
if (proj.tags && proj.tags.length > 0) {
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
el += '<div class="caps">';
|
|
9
|
+
for (let tag of proj.tags) {
|
|
10
|
+
el += '<span class="cap breadcrumb"' + category_color(tag) + '>' + tag + '</span>';
|
|
11
|
+
}
|
|
12
|
+
el += '</div>';
|
|
18
13
|
}
|
|
19
14
|
el += '<h2 class="post-title">' + (proj.title || proj.name) + '</h2>';
|
|
20
15
|
if (proj.description) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<% if (page.layout === 'post' || (page.layout === 'wiki' && page.wiki && page.wiki.length > 0)) { %>
|
|
2
2
|
<script>
|
|
3
|
-
let tianliGPT_postSelector = '.md-text.content.<%= page.layout ===
|
|
3
|
+
let tianliGPT_postSelector = '.md-text.content.<%= page.layout === "post" ? "post" : "wiki" %>';
|
|
4
4
|
let tianliGPT_key = '<%= theme.plugins.tianli_gpt.api %>';
|
|
5
|
+
let tianliGPT_typingAnimate = '<%= theme.plugins.tianli_gpt.typingAnimate %>';
|
|
5
6
|
</script>
|
|
6
|
-
<script defer src="https://cdn1.tianli0.top/gh/zhheo/Post-Abstract-AI@0.
|
|
7
|
+
<script defer src="https://cdn1.tianli0.top/gh/zhheo/Post-Abstract-AI@0.13/tianli_gpt.js"></script>
|
|
7
8
|
<% } %>
|
|
@@ -12,8 +12,8 @@ if (theme.comments.service && theme.comments.service.length > 0) {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
// 合并项目评论
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
let proj = theme.wiki.tree[page.wiki];
|
|
16
|
+
if (loadComment && page.layout == 'wiki' && page.wiki && (proj != null)) {
|
|
17
17
|
if (proj.comment_title != undefined && page.comment_title == undefined) {
|
|
18
18
|
if (['utterances', 'beaudar', 'giscus'].includes(theme.comments.service)) {
|
|
19
19
|
page.comment_title = proj.comment_title;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<%
|
|
2
2
|
var proj;
|
|
3
3
|
if (page.layout === 'wiki' && page.wiki) {
|
|
4
|
-
proj = theme.wiki.
|
|
4
|
+
proj = theme.wiki.tree[page.wiki];
|
|
5
5
|
}
|
|
6
6
|
// 默认组件
|
|
7
7
|
if (page.sidebar == undefined) {
|
|
8
8
|
if (page.layout == 'post' && page.content) {
|
|
9
9
|
page.sidebar = theme.sidebar.widgets.post;
|
|
10
10
|
} else if (page.layout == 'wiki' && page.content && page.wiki) {
|
|
11
|
-
let proj = theme.wiki.
|
|
12
|
-
if (proj
|
|
11
|
+
let proj = theme.wiki.tree[page.wiki];
|
|
12
|
+
if (proj?.sidebar) {
|
|
13
13
|
page.sidebar = proj.sidebar;
|
|
14
14
|
} else {
|
|
15
15
|
page.sidebar = theme.sidebar.widgets.wiki;
|
|
@@ -56,7 +56,7 @@ function layoutWidgets() {
|
|
|
56
56
|
el += '<widget class="widget-wrapper logo-wrap wiki"><div class="widget-body">';
|
|
57
57
|
// all products
|
|
58
58
|
el += '<a style="filter: grayscale(100%)" class="wiki-home cap" href="' + url_for(config.wiki_dir) + '">';
|
|
59
|
-
el += '<svg aria-hidden="true" viewBox="0 0 16 16" width="
|
|
59
|
+
el += '<svg aria-hidden="true" viewBox="0 0 16 16" width="1.2em" height="1.2em" fill="currentColor"><path fill-rule="evenodd" d="M7.78 12.53a.75.75 0 01-1.06 0L2.47 8.28a.75.75 0 010-1.06l4.25-4.25a.75.75 0 011.06 1.06L4.81 7h7.44a.75.75 0 010 1.5H4.81l2.97 2.97a.75.75 0 010 1.06z"></path></svg>';
|
|
60
60
|
el += __('btn.all_wiki');
|
|
61
61
|
el += '</a>';
|
|
62
62
|
// this product
|
|
@@ -6,7 +6,7 @@ function layoutDiv() {
|
|
|
6
6
|
if (page.repo) {
|
|
7
7
|
repo = page.repo
|
|
8
8
|
} else if (page.layout === 'wiki' && page.wiki) {
|
|
9
|
-
let proj = theme.wiki.
|
|
9
|
+
let proj = theme.wiki.tree[page.wiki];
|
|
10
10
|
if (proj && proj.repo) {
|
|
11
11
|
repo = proj.repo;
|
|
12
12
|
if (proj.branch != undefined) {
|
|
@@ -6,7 +6,7 @@ function layoutDiv() {
|
|
|
6
6
|
if (page.repo) {
|
|
7
7
|
repo = page.repo
|
|
8
8
|
} else if (page.layout === 'wiki' && page.wiki) {
|
|
9
|
-
let proj = theme.wiki.
|
|
9
|
+
let proj = theme.wiki.tree[page.wiki];
|
|
10
10
|
if (proj && proj.repo) {
|
|
11
11
|
repo = proj.repo;
|
|
12
12
|
if (proj.branch != undefined) {
|
|
@@ -42,7 +42,7 @@ function layoutDiv() {
|
|
|
42
42
|
el += '</div>';
|
|
43
43
|
// follow
|
|
44
44
|
el += '<a class="follow" href="https://github.com/' + item.username + '">';
|
|
45
|
-
el += '<svg aria-hidden="true" role="img" class="color-icon-primary" viewBox="0 0 16 16" width="
|
|
45
|
+
el += '<svg aria-hidden="true" role="img" class="color-icon-primary" viewBox="0 0 16 16" width="1em" height="1em" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>';
|
|
46
46
|
el += 'Follow';
|
|
47
47
|
el += '</a>';
|
|
48
48
|
// menu
|
|
@@ -15,8 +15,8 @@ function layoutDiv() {
|
|
|
15
15
|
if (page.menu_id == 'wiki') {
|
|
16
16
|
arr = theme.wiki.all_pages.filter( p => {
|
|
17
17
|
if (p.wiki) {
|
|
18
|
-
let proj = theme.wiki.
|
|
19
|
-
return proj
|
|
18
|
+
let proj = theme.wiki.tree[p.wiki];
|
|
19
|
+
return proj?.index != false;
|
|
20
20
|
}
|
|
21
21
|
return false
|
|
22
22
|
})
|
|
@@ -32,7 +32,7 @@ function layoutDiv() {
|
|
|
32
32
|
el += '<a class="item title" href="' + url_for(post.link || post.path) + '">';
|
|
33
33
|
el += '<span class="title">'
|
|
34
34
|
if (post.layout == 'wiki') {
|
|
35
|
-
let proj = theme.wiki.
|
|
35
|
+
let proj = theme.wiki.tree[post.wiki];
|
|
36
36
|
let name = proj?.name || post?.wiki;
|
|
37
37
|
if (name) {
|
|
38
38
|
el += '<strong>' + name + '</strong>' + '<span class="dot"></span>';
|
|
@@ -3,36 +3,28 @@ function layoutDiv() {
|
|
|
3
3
|
if (page.layout !== "wiki") {
|
|
4
4
|
return '';
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
proj.related.forEach((pid, i) => {
|
|
10
|
-
let p = theme.wiki.projects[pid];
|
|
11
|
-
if (p && p.title !== proj.title && p.index !== false) {
|
|
12
|
-
related.push(p);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
6
|
+
let thisItemObject = theme.wiki.tree[page.wiki];
|
|
7
|
+
if (thisItemObject == null) {
|
|
8
|
+
return '';
|
|
15
9
|
}
|
|
10
|
+
const relatedItems = thisItemObject.relatedItems;
|
|
16
11
|
var el = '';
|
|
17
|
-
|
|
12
|
+
for (let relatedItem of relatedItems) {
|
|
18
13
|
el += '<widget class="widget-wrapper related">';
|
|
19
14
|
el += '<div class="widget-header cap theme dis-select">';
|
|
20
|
-
|
|
21
|
-
if (proj.tags && proj.tags[0]) {
|
|
22
|
-
title = proj.tags[0];
|
|
23
|
-
}
|
|
24
|
-
el += '<span class="name">' + __('meta.more', title) + '</span>';
|
|
15
|
+
el += '<span class="name">' + __('meta.more', relatedItem.name) + '</span>';
|
|
25
16
|
el += '</div>';
|
|
26
17
|
el += '<div class="widget-body related-posts">';
|
|
27
|
-
|
|
18
|
+
for (let id of relatedItem.items) {
|
|
28
19
|
// 同一个分组中的其它项目
|
|
29
|
-
|
|
30
|
-
el += '<
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
let item = theme.wiki.tree[id];
|
|
21
|
+
el += '<a class="item wiki" href="' + url_for(item.homepage?.path) + '">';
|
|
22
|
+
el += '<span class="title">' + item.title + '</span>';
|
|
23
|
+
if (item.description && item.description.length > 0) {
|
|
24
|
+
el += '<span class="excerpt">' + item.description + '</span>';
|
|
33
25
|
}
|
|
34
26
|
el += '</a>';
|
|
35
|
-
}
|
|
27
|
+
}
|
|
36
28
|
el += '</div>';
|
|
37
29
|
el += '</widget>';
|
|
38
30
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%
|
|
2
|
-
let proj = theme.wiki.
|
|
2
|
+
let proj = theme.wiki.tree[page.wiki];
|
|
3
3
|
|
|
4
4
|
function layoutToc() {
|
|
5
5
|
if (toc(page.content).length > 0) {
|
|
@@ -22,7 +22,10 @@ function layoutTocHeader(title) {
|
|
|
22
22
|
|
|
23
23
|
function layoutDocTree(pages) {
|
|
24
24
|
var el = '';
|
|
25
|
-
|
|
25
|
+
for (let p of pages) {
|
|
26
|
+
if (p.title == null || p.title.length == 0) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
26
29
|
let isActive = '';
|
|
27
30
|
if (p.path === page.path) {
|
|
28
31
|
isActive += ' active';
|
|
@@ -34,14 +37,14 @@ function layoutDocTree(pages) {
|
|
|
34
37
|
href += '#start'
|
|
35
38
|
}
|
|
36
39
|
el += '<a class="doc-tree-link' + isActive + '" href="' + href + '">';
|
|
37
|
-
el += '<span class="toc-text">' +
|
|
40
|
+
el += '<span class="toc-text">' + p.title + '</span>';
|
|
38
41
|
el += '</a>';
|
|
39
42
|
}
|
|
40
43
|
if (p.path === page.path) {
|
|
41
44
|
el += layoutToc();
|
|
42
45
|
}
|
|
43
46
|
el += '</div>';
|
|
44
|
-
}
|
|
47
|
+
}
|
|
45
48
|
return el;
|
|
46
49
|
}
|
|
47
50
|
|
|
@@ -74,17 +77,22 @@ function layoutDiv(fallback) {
|
|
|
74
77
|
el += '</div>';
|
|
75
78
|
} else if (proj) {
|
|
76
79
|
// wiki 布局
|
|
77
|
-
if (proj.sections && proj.sections.length > 0) {
|
|
78
|
-
proj.sections
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
if (proj.sections && proj.sections.length > 0 && proj.pages.length > 1) { // 多 pages
|
|
81
|
+
for (let sec of proj.sections) {
|
|
82
|
+
if (sec.pages.length == 0) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (sec.title?.length > 0) {
|
|
86
|
+
el += layoutTocHeader(sec.title);
|
|
87
|
+
}
|
|
81
88
|
el += '<div class="widget-body fs14">';
|
|
82
89
|
el += layoutDocTree(sec.pages);
|
|
83
90
|
el += '</div>';
|
|
84
|
-
}
|
|
85
|
-
} else {
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
}
|
|
92
|
+
} else { // 单 page
|
|
93
|
+
if (proj.pages.length == 1) {
|
|
94
|
+
el += layoutTocHeader(page.toc_title);
|
|
95
|
+
}
|
|
88
96
|
el += '<div class="widget-body fs14">';
|
|
89
97
|
el += layoutDocTree(proj.pages);
|
|
90
98
|
el += '</div>';
|
package/layout/index.ejs
CHANGED
|
@@ -22,7 +22,7 @@ function layout_post_card(layout, post, content) {
|
|
|
22
22
|
return el;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function
|
|
25
|
+
function layout_post_list(partial) {
|
|
26
26
|
var el = '';
|
|
27
27
|
el += '<div class="post-list post">';
|
|
28
28
|
if (is_home()) {
|
|
@@ -48,22 +48,24 @@ function layout_posts(partial) {
|
|
|
48
48
|
return el;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
function
|
|
51
|
+
function layout_wiki_list(partial) {
|
|
52
52
|
var el = '';
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
const { shelf, tree } = theme.wiki;
|
|
54
|
+
for (let pid of shelf) {
|
|
55
|
+
let proj = tree[pid];
|
|
56
|
+
if (proj == null) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (proj.pages == undefined || proj.pages.length === 0) {
|
|
58
60
|
continue;
|
|
59
61
|
}
|
|
60
62
|
if (page.filter === false) {
|
|
61
|
-
//
|
|
63
|
+
// wikiList
|
|
62
64
|
el += '<div class="post-list wiki">';
|
|
63
65
|
el += layout_post_card('wiki', proj.homepage, partial(proj));
|
|
64
66
|
el += '</div>';
|
|
65
67
|
} else if (proj.tags && proj.tags.includes(page.tagName) === true) {
|
|
66
|
-
// filtered
|
|
68
|
+
// filtered wikiList
|
|
67
69
|
el += '<div class="post-list wiki filter">';
|
|
68
70
|
el += layout_post_card('wiki', proj.homepage, partial(proj));
|
|
69
71
|
el += '</div>';
|
|
@@ -75,13 +77,13 @@ function layout_wikis(partial) {
|
|
|
75
77
|
|
|
76
78
|
<% if (page.menu_id === 'post') { %>
|
|
77
79
|
<%- partial('_partial/main/navbar/list_post') %>
|
|
78
|
-
<%-
|
|
80
|
+
<%- layout_post_list(function(post){
|
|
79
81
|
return partial('_partial/main/post_list/post_card', {post: post})
|
|
80
82
|
}) %>
|
|
81
83
|
<%- partial('_partial/main/post_list/paginator') %>
|
|
82
84
|
<% } else if (page.menu_id === 'wiki') { %>
|
|
83
85
|
<%- partial('_partial/main/navbar/list_wiki') %>
|
|
84
|
-
<%-
|
|
86
|
+
<%- layout_wiki_list(function(proj){
|
|
85
87
|
return partial('_partial/main/post_list/wiki_card', {proj: proj})
|
|
86
88
|
}) %>
|
|
87
89
|
<% } %>
|
package/layout/mermaid.ejs
CHANGED
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
<script>
|
|
5
5
|
var mermaid_config = {
|
|
6
6
|
startOnLoad: true,
|
|
7
|
-
theme:
|
|
7
|
+
theme:
|
|
8
|
+
"<%- theme.style.darkmode %>" == "auto" &&
|
|
9
|
+
window.matchMedia("(prefers-color-scheme: dark)").matches
|
|
10
|
+
? "dark"
|
|
11
|
+
: "<%- theme.plugins.mermaid.theme %>",
|
|
8
12
|
logLevel: 3,
|
|
9
13
|
themeVariables: {
|
|
10
14
|
darkMode: true
|
|
@@ -12,17 +16,17 @@
|
|
|
12
16
|
flowchart: {
|
|
13
17
|
useMaxWidth: false,
|
|
14
18
|
htmlLabels: true,
|
|
15
|
-
curve:
|
|
19
|
+
curve: "linear"
|
|
16
20
|
},
|
|
17
21
|
gantt: {
|
|
18
|
-
axisFormat:
|
|
22
|
+
axisFormat: "%Y/%m/%d"
|
|
19
23
|
},
|
|
20
24
|
sequence: {
|
|
21
25
|
actorMargin: 50
|
|
22
26
|
}
|
|
23
27
|
}
|
|
24
28
|
if (window.mermaid) {
|
|
25
|
-
|
|
29
|
+
mermaid.initialize(mermaid_config);
|
|
26
30
|
}
|
|
27
31
|
</script>
|
|
28
32
|
<% } %>
|
package/layout/page.ejs
CHANGED
|
@@ -12,6 +12,9 @@ function layoutDiv() {
|
|
|
12
12
|
if (page.post_list) {
|
|
13
13
|
el += partial('_partial/main/navbar/list_post');
|
|
14
14
|
}
|
|
15
|
+
if (page.mermaid == true) {
|
|
16
|
+
el += partial('mermaid');
|
|
17
|
+
}
|
|
15
18
|
if (page.h1 || page.title || (page.content && page.content.length > 0)) {
|
|
16
19
|
el += partial('_partial/main/navbar/breadcrumb');
|
|
17
20
|
}
|
package/layout/post.ejs
CHANGED
|
@@ -30,7 +30,7 @@ if (theme.plugins.heti && theme.plugins.heti.enable) {
|
|
|
30
30
|
<%- layoutTitle() %>
|
|
31
31
|
<%- post.content %>
|
|
32
32
|
<% if (theme.plugins.tianli_gpt.enable && ['all', 'post'].includes(theme.plugins.tianli_gpt.field)) { %>
|
|
33
|
-
<%- partial('_partial/
|
|
33
|
+
<%- partial('_partial/plugins/ai/tianli_gpt') %>
|
|
34
34
|
<% } %>
|
|
35
35
|
<%- partial('_partial/main/article/article_footer') %>
|
|
36
36
|
</article>
|
package/layout/wiki.ejs
CHANGED
|
@@ -29,12 +29,15 @@ function layoutTitle() {
|
|
|
29
29
|
page.header = 'auto';
|
|
30
30
|
}
|
|
31
31
|
%>
|
|
32
|
+
<% if (page.mermaid == true){ %>
|
|
33
|
+
<%- partial('mermaid') %>
|
|
34
|
+
<% } %>
|
|
32
35
|
<%- partial('_partial/main/navbar/breadcrumb') %>
|
|
33
36
|
<article class='md-text content <%- page.layout %><%- page.indent ? ' indent' : '' %><%- scrollreveal() %>'>
|
|
34
37
|
<%- layoutTitle() %>
|
|
35
38
|
<%- page.content %>
|
|
36
39
|
<% if (theme.plugins.tianli_gpt.enable && ['all', 'wiki'].includes(theme.plugins.tianli_gpt.field)) { %>
|
|
37
|
-
<%- partial('_partial/
|
|
40
|
+
<%- partial('_partial/plugins/ai/tianli_gpt') %>
|
|
38
41
|
<% } %>
|
|
39
42
|
<%- partial('_partial/main/article/article_footer') %>
|
|
40
43
|
</article>
|