hexo-theme-stellar 1.24.1 → 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.
Files changed (136) hide show
  1. package/_config.yml +122 -50
  2. package/_data/icons.yml +33 -0
  3. package/_data/widgets.yml +2 -16
  4. package/languages/en.yml +2 -1
  5. package/languages/zh-CN.yml +3 -2
  6. package/languages/zh-TW.yml +3 -2
  7. package/layout/404.ejs +2 -4
  8. package/layout/_partial/cover/index.ejs +5 -5
  9. package/layout/_partial/cover/post_cover.ejs +1 -1
  10. package/layout/_partial/cover/wiki_cover.ejs +2 -2
  11. package/layout/_partial/head.ejs +6 -9
  12. package/layout/_partial/main/article/article_footer.ejs +16 -24
  13. package/layout/_partial/main/article/read_next.ejs +13 -13
  14. package/layout/_partial/main/article/related_posts.ejs +1 -1
  15. package/layout/_partial/main/footer.ejs +1 -1
  16. package/layout/_partial/main/navbar/article_top_area.ejs +35 -0
  17. package/layout/_partial/main/navbar/author_banner.ejs +1 -3
  18. package/layout/_partial/main/navbar/breadcrumb/blog.ejs +34 -0
  19. package/layout/_partial/main/navbar/breadcrumb/page.ejs +10 -0
  20. package/layout/_partial/main/navbar/breadcrumb/wiki.ejs +20 -0
  21. package/layout/_partial/main/navbar/dateinfo.ejs +32 -0
  22. package/layout/_partial/main/navbar/ghinfo.ejs +25 -0
  23. package/layout/_partial/main/navbar/{list_post.ejs → nav_tabs_blog.ejs} +15 -7
  24. package/layout/_partial/main/navbar/{list_wiki.ejs → nav_tabs_wiki.ejs} +15 -1
  25. package/layout/_partial/main/post_list/paginator.ejs +1 -1
  26. package/layout/_partial/main/post_list/post_card.ejs +4 -15
  27. package/layout/_partial/main/post_list/topic_card.ejs +16 -0
  28. package/layout/_partial/menubtn.ejs +1 -1
  29. package/layout/_partial/plugins/ai/tianli_gpt.ejs +4 -3
  30. package/layout/_partial/plugins/comments/artalk/layout.ejs +1 -1
  31. package/layout/_partial/plugins/comments/artalk/script.ejs +1 -1
  32. package/layout/_partial/plugins/comments/beaudar/layout.ejs +1 -1
  33. package/layout/_partial/plugins/comments/giscus/layout.ejs +1 -1
  34. package/layout/_partial/plugins/comments/layout.ejs +3 -3
  35. package/layout/_partial/plugins/comments/twikoo/layout.ejs +1 -1
  36. package/layout/_partial/plugins/comments/utterances/layout.ejs +1 -1
  37. package/layout/_partial/plugins/comments/waline/layout.ejs +1 -1
  38. package/layout/_partial/sidebar/index.ejs +92 -83
  39. package/layout/_partial/sidebar/logo.ejs +87 -0
  40. package/layout/_partial/sidebar/menu.ejs +23 -18
  41. package/layout/_partial/sidebar/search.ejs +42 -0
  42. package/layout/_partial/widgets/components/link.ejs +21 -0
  43. package/layout/_partial/widgets/components/linklist.ejs +27 -0
  44. package/layout/_partial/widgets/ghissues.ejs +7 -9
  45. package/layout/_partial/widgets/ghrepo.ejs +10 -12
  46. package/layout/_partial/widgets/ghuser.ejs +2 -6
  47. package/layout/_partial/widgets/linklist.ejs +17 -0
  48. package/layout/_partial/widgets/markdown.ejs +5 -2
  49. package/layout/_partial/widgets/recent.ejs +12 -8
  50. package/layout/_partial/widgets/related.ejs +51 -20
  51. package/layout/_partial/widgets/search.ejs +0 -40
  52. package/layout/_partial/widgets/tagcloud.ejs +2 -2
  53. package/layout/_partial/widgets/timeline.ejs +2 -2
  54. package/layout/_partial/widgets/toc.ejs +61 -53
  55. package/layout/archive.ejs +3 -3
  56. package/layout/categories.ejs +2 -2
  57. package/layout/index.ejs +10 -62
  58. package/layout/index_topic.ejs +28 -0
  59. package/layout/index_wiki.ejs +42 -0
  60. package/layout/layout.ejs +53 -21
  61. package/layout/page.ejs +60 -13
  62. package/layout/tags.ejs +2 -2
  63. package/package.json +2 -2
  64. package/scripts/events/index.js +5 -0
  65. package/scripts/events/lib/authors.js +1 -1
  66. package/scripts/events/lib/config.js +28 -24
  67. package/scripts/events/lib/doc_tree.js +27 -19
  68. package/scripts/events/lib/merge_posts.js +46 -0
  69. package/scripts/events/lib/topic_tree.js +45 -0
  70. package/scripts/generators/404.js +8 -3
  71. package/scripts/generators/author.js +4 -2
  72. package/scripts/generators/categories.js +4 -4
  73. package/scripts/generators/tags.js +4 -4
  74. package/scripts/generators/topic.js +21 -0
  75. package/scripts/generators/wiki.js +30 -28
  76. package/scripts/helpers/category_color.js +1 -1
  77. package/scripts/helpers/icon.js +16 -0
  78. package/scripts/helpers/parse_config.js +20 -18
  79. package/scripts/helpers/scrollreveal.js +6 -6
  80. package/scripts/tags/lib/audio.js +9 -4
  81. package/scripts/tags/lib/navbar.js +1 -1
  82. package/scripts/tags/lib/toc.js +1 -1
  83. package/scripts/tags/lib/video.js +8 -8
  84. package/source/css/_common/blur.styl +5 -9
  85. package/source/css/_common/cap.styl +1 -1
  86. package/source/css/_common/device.styl +2 -2
  87. package/source/css/_common/highlight.styl +3 -2
  88. package/source/css/_common/layout.styl +6 -0
  89. package/source/css/_common/svg.styl +3 -0
  90. package/source/css/_custom.styl +9 -2
  91. package/source/css/_defines/theme.styl +10 -0
  92. package/source/css/_layout/layout.styl +17 -4
  93. package/source/css/_layout/list.styl +5 -2
  94. package/source/css/_layout/main.styl +5 -4
  95. package/source/css/_layout/md.styl +12 -11
  96. package/source/css/_layout/partial/paginator.styl +2 -2
  97. package/source/css/_layout/partial/related.styl +3 -0
  98. package/source/css/_layout/sidebar/footer.styl +4 -31
  99. package/source/css/_layout/sidebar/{header.styl → logo.styl} +11 -41
  100. package/source/css/_layout/sidebar/menu.styl +53 -0
  101. package/source/css/_layout/sidebar/nav-area.styl +2 -0
  102. package/source/css/_layout/sidebar/search.styl +106 -0
  103. package/source/css/_layout/sidebar/sidebar.styl +21 -31
  104. package/source/css/_layout/tag-plugins/banner.styl +9 -7
  105. package/source/css/_layout/tag-plugins/frame.styl +1 -1
  106. package/source/css/_layout/tag-plugins/okr.styl +0 -1
  107. package/source/css/_layout/tag-plugins/tabs.styl +2 -2
  108. package/source/css/_layout/tag-plugins/toc.styl +1 -1
  109. package/source/css/_layout/widgets/components.styl +49 -0
  110. package/source/css/_layout/widgets/ghrepo.styl +0 -1
  111. package/source/css/_layout/widgets/ghuser.styl +0 -23
  112. package/source/css/_layout/widgets/list.styl +28 -0
  113. package/source/css/_layout/widgets/markdown.styl +20 -0
  114. package/source/css/_layout/widgets/related.styl +36 -5
  115. package/source/css/_layout/widgets/timeline.styl +21 -2
  116. package/source/css/_layout/widgets/toc_blog.styl +1 -1
  117. package/source/css/_layout/widgets/toc_common.styl +12 -12
  118. package/source/css/_layout/widgets/toc_wiki.styl +38 -25
  119. package/source/css/_layout/widgets/widgets.styl +25 -20
  120. package/source/css/_plugins/comments/twikoo.styl +9 -9
  121. package/source/css/_plugins/scrollreveal.styl +1 -1
  122. package/source/css/_plugins/tianli_gpt.styl +12 -14
  123. package/source/js/main.js +5 -2
  124. package/source/js/plugins/copycode.js +3 -3
  125. package/source/js/plugins/fcircle.js +1 -1
  126. package/source/js/plugins/friends.js +1 -1
  127. package/source/js/plugins/memos.js +1 -1
  128. package/source/js/plugins/sites.js +2 -2
  129. package/source/js/plugins/weibo.js +1 -1
  130. package/layout/_partial/main/header/index.ejs +0 -3
  131. package/layout/_partial/main/navbar/breadcrumb.ejs +0 -139
  132. package/layout/_partial/sidebar/header.ejs +0 -59
  133. package/layout/post.ejs +0 -33
  134. package/layout/wiki.ejs +0 -43
  135. package/source/css/_layout/widgets/recent.styl +0 -15
  136. package/source/css/_layout/widgets/search.styl +0 -102
@@ -2,7 +2,7 @@
2
2
  function layoutDiv() {
3
3
  if (theme.article.related_posts.enable) {
4
4
  var el = '';
5
- el += '<div class="related-wrap reveal" id="related-posts">';
5
+ el += `<div class="related-wrap${scrollreveal(' ')}" id="related-posts">`
6
6
  el += popular_posts_wrapper({
7
7
  title: __('meta.related_posts'),
8
8
  json: popular_posts_json({ maxCount: theme.article.related_posts.max_count , ulClass: 'related-posts' , PPMixingRate: 0.2 , isImage: true , isExcerpt: true} , page )
@@ -2,7 +2,7 @@
2
2
  const content = theme.footer.content?.replace('${author.name}', (config.author || 'Anonymity'))?.replace('${theme.name}', stellar_info('name'))?.replace('${theme.version}', stellar_info('version'))?.replace('${theme.tree}', stellar_info('tree'))
3
3
  function layoutDiv() {
4
4
  var el = ''
5
- el += '<footer class="page-footer reveal fs12">'
5
+ el += `<footer class="page-footer${scrollreveal(' ')} fs12">`
6
6
  el += '<hr>'
7
7
  // sitemap
8
8
  if (theme.footer.sitemap && Object.keys(theme.footer.sitemap).length > 0) {
@@ -0,0 +1,35 @@
1
+ <%
2
+ function layoutDiv() {
3
+ if (page.breadcrumb === false) {
4
+ return ''
5
+ }
6
+ var el = ''
7
+ // 1.main
8
+ el += `<div class="bread-nav fs12">`
9
+ // 2.left
10
+ el += `<div class="left">`
11
+ // 3.left.top: 面包屑导航
12
+ el += `<div id="breadcrumb">`
13
+ // 首页
14
+ el += `<a class="cap breadcrumb" href="${url_for(config.root)}">${__("btn.home")}</a>`
15
+ if (theme.wiki.tree[page.wiki]) {
16
+ el += partial('breadcrumb/wiki')
17
+ } else if (page.layout == 'post') {
18
+ el += partial('breadcrumb/blog')
19
+ } else {
20
+ el += partial('breadcrumb/page')
21
+ }
22
+ // end 3.left.top
23
+ el += `</div>`
24
+ // 3.left.bottom
25
+ el += partial('dateinfo')
26
+ // end 2.left
27
+ el += `</div>`
28
+ // 2.right
29
+ el += partial('ghinfo')
30
+ // end 1.main
31
+ el += `</div>`
32
+ return el
33
+ }
34
+ %>
35
+ <%- layoutDiv() %>
@@ -10,9 +10,7 @@ function layoutDiv() {
10
10
  <div class="content">
11
11
  <div class="top">
12
12
  <button class="back cap" onclick="window.history.back()">
13
- <svg aria-hidden="true" viewBox="0 0 16 16" fill="currentColor">
14
- <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>
15
- </svg>
13
+ ${icon('default:goback')}
16
14
  </button>
17
15
  </div>
18
16
  <div class="bottom">
@@ -0,0 +1,34 @@
1
+ <%
2
+ function layoutDiv() {
3
+ const topicObject = theme.topic.tree[page.topic]
4
+ var el = ''
5
+ if (topicObject) { // 专栏文章
6
+ // 专栏列表页
7
+ const topicIndexPageURL = url_for(theme.site_tree.index_topic.base_dir)
8
+ el += `<span class="sep"></span>`
9
+ el += `<a class="cap breadcrumb" id="menu" href="${topicIndexPageURL}">${__("btn.topic")}</a>`
10
+ // 专栏项目名
11
+ const topicHomePageURL = url_for(topicObject.homepage?.path);
12
+ if (topicHomePageURL != topicIndexPageURL) {
13
+ el += `<span class="sep"></span>`
14
+ el += `<a class="cap breadcrumb" id="proj" href="${topicHomePageURL}">${topicObject.name || topicObject.title}</a>`
15
+ }
16
+ } else { // 普通文章
17
+ // 文章列表页
18
+ el += `<span class="sep"></span>`
19
+ el += `<a class="cap breadcrumb" href="${url_for(config.index_generator.path)}">${__("btn.blog")}</a>`
20
+ // 分类列表页
21
+ if (page.categories?.length > 0) {
22
+ el += `<span class="sep"></span>`
23
+ el += list_categories(page.categories, {
24
+ class: "cap breadcrumb",
25
+ show_count: false,
26
+ separator: ' <span class="sep"></span> ',
27
+ style: "none"
28
+ })
29
+ }
30
+ }
31
+ return el
32
+ }
33
+ %>
34
+ <%- layoutDiv() %>
@@ -0,0 +1,10 @@
1
+ <%
2
+ function layoutDiv() {
3
+ // 普通页面就显示当前页面
4
+ return `
5
+ <span class="sep"></span>
6
+ <a class="cap breadcrumb" href="${url_for(page.path)}">${page.title}</a>
7
+ `
8
+ }
9
+ %>
10
+ <%- layoutDiv() %>
@@ -0,0 +1,20 @@
1
+ <%
2
+ function layoutDiv() {
3
+ const wikiObject = theme.wiki.tree[page.wiki]
4
+ var el = ''
5
+ // 文档列表页
6
+ el += `<span class="sep"></span>`
7
+ const wikiIndexPageURL = url_for(theme.site_tree.index_wiki.base_dir)
8
+ el += `<a class="cap breadcrumb" id="menu" href="${wikiIndexPageURL}">${__("btn.wiki")}</a>`
9
+ if (wikiObject) {
10
+ // 文档项目名
11
+ const wikiHomePageURL = url_for(wikiObject.homepage?.path);
12
+ if (wikiHomePageURL != wikiIndexPageURL) {
13
+ el += `<span class="sep"></span>`
14
+ el += `<a class="cap breadcrumb" id="proj" href="${wikiHomePageURL}">${wikiObject.name || wikiObject.title}</a>`
15
+ }
16
+ }
17
+ return el
18
+ }
19
+ %>
20
+ <%- layoutDiv() %>
@@ -0,0 +1,32 @@
1
+ <%
2
+ function layoutDiv() {
3
+ // 作者
4
+ const author = theme.authors ? (theme.authors[page.author] || theme.default_author) : null
5
+ var el = ''
6
+ el += `<div id="post-meta">`
7
+ if (page.wiki) {
8
+ el += `<span class="author">${__("meta.updated") + __("symbol.colon")}</span>`
9
+ el += `<time datetime="${date_xml(page.updated)}">${date(page.updated, config.date_format)}</time>`
10
+ el += `</span>`
11
+ } else {
12
+ if (author) {
13
+ const link = `<a href="${url_for(author.path)}">${author.name}</a>`
14
+ el += `<span class="author">${__("meta.created_author", link) + __("symbol.colon")}</span>`
15
+ } else {
16
+ el += `<span class="author">${__("meta.created") + __("symbol.colon")}</span>`
17
+ }
18
+ // 发布日期
19
+ el += `<span class="created">`
20
+ el += `<time datetime="${date_xml(page.date)}">${date(page.date, config.date_format)}</time>`
21
+ el += `</span>`
22
+ // 更新日期
23
+ el += `<span class="updated">`
24
+ el += `${__("symbol.comma") + __("meta.updated") + __("symbol.colon")}`
25
+ el += `<time datetime="${date_xml(page.updated)}">${date(page.updated, config.date_format)}</time>`
26
+ el += `</span>`
27
+ }
28
+ el += `</div>`
29
+ return el
30
+ }
31
+ %>
32
+ <%- layoutDiv() %>
@@ -0,0 +1,25 @@
1
+ <%
2
+ function layoutDiv() {
3
+ const repo = page.repo || theme.wiki.tree[page.wiki]?.repo
4
+ if (repo == null) {
5
+ return ''
6
+ }
7
+ return `
8
+ <div class="right ghrepo stellar-ghinfo-api" api="${theme.api_host.ghapi}/repos/${repo}">
9
+ <a class="repo-link bold" href="https://github.com/${repo}">
10
+ ${icon('github:repo')}
11
+ <span type="text">${repo}</span>
12
+ </a>
13
+ <a class="repo-link" href="https://github.com/${repo}/stargazers">
14
+ ${icon('github:star')}
15
+ <span type="text" id="stargazers_count">0</span><span>stars</span>
16
+ </a>
17
+ <a class="repo-link" href="https://github.com/${repo}/forks">
18
+ ${icon('github:fork')}
19
+ <span type="text" id="forks_count">0</span><span>forks</span>
20
+ </a>
21
+ </div>
22
+ `
23
+ }
24
+ %>
25
+ <%- layoutDiv() %>
@@ -29,6 +29,14 @@ function layoutDiv() {
29
29
  }
30
30
  }
31
31
 
32
+ if (theme.topic?.publish_list?.length > 0) {
33
+ if (page.layout == 'index_topic') {
34
+ el += '<a class="active" href="' + url_for(theme.site_tree.index_topic.base_dir) + '">' + __("btn.topic") + '</a>';
35
+ } else {
36
+ el += '<a href="' + url_for(theme.site_tree.index_topic.base_dir) + '">' + __("btn.topic") + '</a>';
37
+ }
38
+ }
39
+
32
40
  if (site.posts && site.posts.length > 0) {
33
41
  if (is_archive()) {
34
42
  el += '<a class="active" href="' + url_for(config.archive_dir) + '">' + __("btn.archives") + '</a>';
@@ -37,15 +45,15 @@ function layoutDiv() {
37
45
  }
38
46
  }
39
47
 
40
- if (theme['post-index']) {
41
- const obj = theme['post-index'];
42
- for (let key of Object.keys(obj)) {
48
+ const { nav_tabs } = theme.site_tree.index_blog
49
+ if (nav_tabs) {
50
+ for (let key of Object.keys(nav_tabs)) {
43
51
  // 当 page 的末尾为 index.html 或者处于该 page 的某个子页面时也应该匹配
44
- // if (full_url_for(page.path) == full_url_for(obj[key])) {
45
- if (full_url_for(page.path).startsWith(full_url_for(obj[key]))){
46
- el += '<a class="active" href="' + url_for(obj[key]) + '">' + key + '</a>';
52
+ // if (full_url_for(page.path) == full_url_for(nav_tabs[key])) {
53
+ if (full_url_for(page.path).startsWith(full_url_for(nav_tabs[key]))){
54
+ el += '<a class="active" href="' + url_for(nav_tabs[key]) + '">' + key + '</a>';
47
55
  } else {
48
- el += '<a href="' + url_for(obj[key]) + '">' + key + '</a>';
56
+ el += '<a href="' + url_for(nav_tabs[key]) + '">' + key + '</a>';
49
57
  }
50
58
  }
51
59
  }
@@ -8,7 +8,7 @@ function layoutDiv() {
8
8
  if (page.filter === false) {
9
9
  el += ' class="active"';
10
10
  }
11
- el += ' href="' + url_for(config.wiki_dir || "/wiki/") + '">' + __("btn.all_wiki") + '</a>';
11
+ el += ' href="' + url_for(theme.site_tree.index_wiki.base_dir) + '">' + __("btn.all_wiki") + '</a>';
12
12
  el += '</a>';
13
13
  // 项目分类
14
14
  const { shelf, all_tags } = theme.wiki;
@@ -24,6 +24,20 @@ function layoutDiv() {
24
24
  el += '</a>';
25
25
  }
26
26
  }
27
+
28
+ const { nav_tabs } = theme.site_tree.index_wiki
29
+ if (nav_tabs) {
30
+ for (let key of Object.keys(nav_tabs)) {
31
+ // 当 page 的末尾为 index.html 或者处于该 page 的某个子页面时也应该匹配
32
+ // if (full_url_for(page.path) == full_url_for(nav_tabs[key])) {
33
+ if (full_url_for(page.path).startsWith(full_url_for(nav_tabs[key]))){
34
+ el += '<a class="active" href="' + url_for(nav_tabs[key]) + '">' + key + '</a>';
35
+ } else {
36
+ el += '<a href="' + url_for(nav_tabs[key]) + '">' + key + '</a>';
37
+ }
38
+ }
39
+ }
40
+
27
41
  el += '</nav>';
28
42
  el += '</div>';
29
43
  return el;
@@ -1,5 +1,5 @@
1
1
  <% if ((is_home() || is_category() || is_tag()) && page.total > 1) { %>
2
- <div class='paginator-wrap dis-select'>
2
+ <div class='paginator-wrap dis-select<%- scrollreveal(' ') %>'>
3
3
  <%- paginator({
4
4
  prev_text: '',
5
5
  next_text: '',
@@ -46,7 +46,7 @@ function div_default() {
46
46
 
47
47
  // 标题
48
48
  el += '<h2 class="post-title">';
49
- el += (post.title || post.seo_title) ? (post.title || post.seo_title) : date(post.date, config.date_format);
49
+ el += post.title ? post.title : date(post.date, config.date_format);
50
50
  el += '</h2>';
51
51
 
52
52
  // 摘要
@@ -69,18 +69,7 @@ function div_default() {
69
69
  // meta
70
70
  el += '<div class="meta cap">';
71
71
  el += '<span class="cap" id="post-meta">';
72
- // author
73
- var author = null
74
- if (theme.authors) {
75
- if (page.author?.length > 0 && theme.authors[page.author] != null) {
76
- author = theme.authors[page.author]
77
- } else {
78
- author = theme.default_author
79
- }
80
- }
81
- if (author) {
82
- el += author.name + '&nbsp;'
83
- }
72
+
84
73
  // time
85
74
  el += __("meta.created") + '&nbsp;' + '<time datetime="' + date_xml(post.date) + '">' + date(post.date, config.date_format) + '</time>';
86
75
  el += '</span>';
@@ -101,8 +90,8 @@ function div_default() {
101
90
  }
102
91
  }
103
92
  }
104
- if (post.pin) {
105
- el += '<span class="pin"><img src="https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.9/badge/3279dd441df8b.svg"/></span>';
93
+ if (post.sticky) {
94
+ el += `<span class="pin">${icon('default:pin')}</span>`
106
95
  }
107
96
  el += '</div>';
108
97
  el += '</article>';
@@ -0,0 +1,16 @@
1
+ <%
2
+ function layoutDiv() {
3
+ var el = '';
4
+ el += '<article class="md-text">';
5
+ el += `<div class="preview"><img src="${topic.icon ? topic.icon : theme.default.topic}"/></div>`
6
+ el += '<div class="excerpt">';
7
+ el += '<h2 class="post-title">' + (topic.title || topic.name) + '</h2>';
8
+ if (topic.description) {
9
+ el += '<p>' + topic.description + '</p>';
10
+ }
11
+ el += '</div>';
12
+ el += '</article>';
13
+ return el;
14
+ }
15
+ %>
16
+ <%- layoutDiv() %>
@@ -1,5 +1,5 @@
1
1
  <div class='float-panel mobile-only blur' style='display:none'>
2
2
  <button type='button' class='sidebar-toggle mobile' onclick='sidebar.toggle()'>
3
- <svg class="icon" style="width: 1em; height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15301"><path d="M566.407 808.3c26.9-0.1 49.3-20.8 51.6-47.6-1.9-27.7-23.9-49.7-51.6-51.6h-412.6c-28.2-1.4-52.6 19.5-55.5 47.6 2.3 26.8 24.6 47.5 51.6 47.6h416.5v4z m309.3-249.9c26.9-0.1 49.3-20.8 51.6-47.6-2.2-26.8-24.6-47.5-51.6-47.6h-721.9c-27.7-2.8-52.5 17.4-55.3 45.1-0.1 0.8-0.1 1.7-0.2 2.5 0.9 27.2 23.6 48.5 50.7 47.6H875.707z m-103.1-245.9c26.9-0.1 49.3-20.8 51.6-47.6-0.4-28.3-23.2-51.1-51.5-51.6h-618.9c-29.5-1.1-54.3 21.9-55.5 51.4v0.2c1.4 27.8 25.2 49.2 53 47.8 0.8 0 1.7-0.1 2.5-0.2h618.8z" p-id="15302"></path><path d="M566.407 808.3c26.9-0.1 49.3-20.8 51.6-47.6-1.9-27.7-23.9-49.7-51.6-51.6h-412.6c-28.2-1.4-52.6 19.5-55.5 47.6 1.9 27.7 23.9 49.7 51.6 51.6h416.5z m309.3-249.9c26.9-0.1 49.3-20.8 51.6-47.6-2.2-26.8-24.6-47.5-51.6-47.6h-721.9c-27.7-2.8-52.5 17.4-55.3 45.1-0.1 0.8-0.1 1.7-0.2 2.5 0.9 27.2 23.6 48.5 50.7 47.6H875.707z m-103.1-245.9c26.9-0.1 49.3-20.8 51.6-47.6-0.4-28.3-23.2-51.1-51.5-51.6h-618.9c-29.5-1.1-54.3 21.9-55.5 51.4v0.2c1.4 27.8 25.2 49.2 53 47.8 0.8 0 1.7-0.1 2.5-0.2h618.8z" p-id="15303"></path></svg>
3
+ <%- icon('default:sidebar') %>
4
4
  </button>
5
5
  </div>
@@ -1,8 +1,9 @@
1
- <% if (page.layout === 'post' || (page.layout === 'wiki' && page.wiki && page.wiki.length > 0)) { %>
1
+ <% if (page.layout === 'post' || (page.wiki?.length > 0)) { %>
2
2
  <script>
3
- let tianliGPT_postSelector = '.md-text.content.<%= page.layout === "post" ? "post" : "wiki" %>';
3
+ let tianliGPT_postSelector = 'article.content';
4
4
  let tianliGPT_key = '<%= theme.plugins.tianli_gpt.api %>';
5
5
  let tianliGPT_typingAnimate = '<%= theme.plugins.tianli_gpt.typingAnimate %>';
6
+ let tianliGPT_wordLimit = <%= theme.plugins.tianli_gpt.limit %>;
6
7
  </script>
7
- <script defer src="https://cdn1.tianli0.top/gh/zhheo/Post-Abstract-AI@0.13/tianli_gpt.js"></script>
8
+ <script defer src="https://cdn1.tianli0.top/gh/zhheo/Post-Abstract-AI@0.15.2/tianli_gpt.min.js"></script>
8
9
  <% } %>
@@ -11,7 +11,7 @@ function layoutDiv() {
11
11
  el += ' ' + key + '="' + cfg[key] + '"';
12
12
  }
13
13
  }
14
- el += '><svg class="loading" style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2709"><path d="M832 512c0-176-144-320-320-320V128c211.2 0 384 172.8 384 384h-64zM192 512c0 176 144 320 320 320v64C300.8 896 128 723.2 128 512h64z" p-id="2710"></path></svg></div>';
14
+ el += `>${icon('default:loading')}</div>`
15
15
  return el;
16
16
  }
17
17
  %>
@@ -11,7 +11,7 @@
11
11
  var artalk = Artalk.init({
12
12
  el: '#artalk_container',
13
13
  pageKey: path,
14
- pageTitle: '<%= page.title || page.seo_title %>',
14
+ pageTitle: '<%= page.title %>',
15
15
  server: '<%= theme.comments.artalk.server %>',
16
16
  placeholder: '<%= theme.comments.artalk.placeholder %>',
17
17
  site: '<%= config.title %>',
@@ -17,6 +17,6 @@ function layoutDiv() {
17
17
  }
18
18
  %>
19
19
 
20
- <svg class="loading" style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2709"><path d="M832 512c0-176-144-320-320-320V128c211.2 0 384 172.8 384 384h-64zM192 512c0 176 144 320 320 320v64C300.8 896 128 723.2 128 512h64z" p-id="2710"></path></svg>
20
+ <%- icon('default:loading') %>
21
21
 
22
22
  <%- layoutDiv() %>
@@ -17,6 +17,6 @@ function layoutDiv() {
17
17
  }
18
18
  %>
19
19
 
20
- <svg class="loading" style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2709"><path d="M832 512c0-176-144-320-320-320V128c211.2 0 384 172.8 384 384h-64zM192 512c0 176 144 320 320 320v64C300.8 896 128 723.2 128 512h64z" p-id="2710"></path></svg>
20
+ <%- icon('default:loading') %>
21
21
 
22
22
  <%- layoutDiv() %>
@@ -12,8 +12,8 @@ if (theme.comments.service && theme.comments.service.length > 0) {
12
12
  }
13
13
  }
14
14
  // 合并项目评论
15
- let proj = theme.wiki.tree[page.wiki];
16
- if (loadComment && page.layout == 'wiki' && page.wiki && (proj != null)) {
15
+ const proj = theme.wiki.tree[page.wiki]
16
+ if (loadComment && (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;
@@ -31,7 +31,7 @@ if (cmt.service && page[cmt.service]) {
31
31
  page.cmt = cmt;
32
32
  %>
33
33
  <% if (loadComment) { %>
34
- <div class='related-wrap md-text reveal' id="comments">
34
+ <div class="related-wrap md-text<%- scrollreveal(' ') %>" id="comments">
35
35
  <section class='header cmt-title cap theme'>
36
36
  <%- page.comment_title != undefined ? markdown(page.comment_title) : __('meta.comment_title') %>
37
37
  </section>
@@ -11,7 +11,7 @@ function layoutDiv() {
11
11
  el += ' ' + key + '="' + cfg[key] + '"';
12
12
  }
13
13
  }
14
- el += '><svg class="loading" style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2709"><path d="M832 512c0-176-144-320-320-320V128c211.2 0 384 172.8 384 384h-64zM192 512c0 176 144 320 320 320v64C300.8 896 128 723.2 128 512h64z" p-id="2710"></path></svg></div>';
14
+ el += `>${icon('default:loading')}</div>`
15
15
  return el;
16
16
  }
17
17
  %>
@@ -17,6 +17,6 @@ function layoutDiv() {
17
17
  }
18
18
  %>
19
19
 
20
- <svg class="loading" style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2709"><path d="M832 512c0-176-144-320-320-320V128c211.2 0 384 172.8 384 384h-64zM192 512c0 176 144 320 320 320v64C300.8 896 128 723.2 128 512h64z" p-id="2710"></path></svg>
20
+ <%- icon('default:loading') %>
21
21
 
22
22
  <%- layoutDiv() %>
@@ -11,7 +11,7 @@ function layoutDiv() {
11
11
  el += ' ' + key + '="' + cfg[key] + '"';
12
12
  }
13
13
  }
14
- el += '><svg class="loading" style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2709"><path d="M832 512c0-176-144-320-320-320V128c211.2 0 384 172.8 384 384h-64zM192 512c0 176 144 320 320 320v64C300.8 896 128 723.2 128 512h64z" p-id="2710"></path></svg></div>';
14
+ el += `>${icon('default:loading')}</div>`
15
15
  return el;
16
16
  }
17
17
  %>