hexo-theme-solitude 1.0.0 → 1.1.3

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 (125) hide show
  1. package/README.md +62 -20
  2. package/README_EN.md +98 -0
  3. package/_config.yml +162 -144
  4. package/layout/404.ejs +1 -1
  5. package/layout/layout.ejs +27 -32
  6. package/layout/page/about.ejs +3 -1
  7. package/layout/page/circle.ejs +1 -1
  8. package/layout/page/echarts.ejs +1 -14
  9. package/layout/page/links.ejs +2 -13
  10. package/layout/page/rss.ejs +10 -8
  11. package/layout/page/says.ejs +1 -0
  12. package/layout/partial/body.ejs +0 -1
  13. package/layout/partial/compoment/about/award.ejs +3 -1
  14. package/layout/partial/compoment/about/hobbies.ejs +44 -35
  15. package/layout/partial/compoment/about/other.ejs +68 -60
  16. package/layout/partial/compoment/aside/asideFlipCard.ejs +67 -3
  17. package/layout/partial/compoment/aside/asideHistory.ejs +49 -0
  18. package/layout/partial/compoment/aside/asideNewestPost.ejs +1 -1
  19. package/layout/partial/compoment/aside/asidePower.ejs +3 -3
  20. package/layout/partial/compoment/aside/asideSwitch.ejs +6 -0
  21. package/layout/partial/compoment/aside/asideToc.ejs +1 -1
  22. package/layout/partial/compoment/aside/asideWebInfo.ejs +8 -8
  23. package/layout/partial/compoment/aside/asideWelcome.ejs +33 -0
  24. package/layout/partial/compoment/circle/angle.ejs +2 -2
  25. package/layout/partial/compoment/circle/content.ejs +8 -11
  26. package/layout/partial/compoment/dorakika/rightmenu.ejs +90 -105
  27. package/layout/partial/compoment/hometop/bbTimeList.ejs +1 -1
  28. package/layout/partial/compoment/hometop/groupTag.ejs +1 -1
  29. package/layout/partial/compoment/hometop/topGroup.ejs +11 -18
  30. package/layout/partial/compoment/inject/body.ejs +20 -7
  31. package/layout/partial/compoment/inject/head.ejs +67 -3
  32. package/layout/partial/compoment/links/angle.ejs +26 -0
  33. package/layout/partial/compoment/links/banner.ejs +2 -2
  34. package/layout/partial/compoment/mixins/pagination.ejs +2 -2
  35. package/layout/partial/compoment/nav/right.ejs +6 -6
  36. package/layout/partial/compoment/post/award.ejs +30 -22
  37. package/layout/partial/compoment/post/copyright.ejs +10 -8
  38. package/layout/partial/compoment/post/postMeta.ejs +21 -19
  39. package/layout/partial/compoment/says/saysBottom.ejs +3 -3
  40. package/layout/partial/compoment/says/saysContent.ejs +0 -1
  41. package/layout/partial/compoment/says/saysFunction.ejs +15 -0
  42. package/layout/partial/compoment/third-party/comments/comment.ejs +1 -1
  43. package/layout/partial/compoment/third-party/comments/twikoo.ejs +2 -1
  44. package/layout/partial/compoment/third-party/search/algolia-search.ejs +2 -2
  45. package/layout/partial/compoment/third-party/search/local-search.ejs +2 -2
  46. package/layout/partial/console.ejs +10 -4
  47. package/layout/partial/footer.ejs +11 -9
  48. package/layout/partial/nav.ejs +2 -2
  49. package/layout/partial/sidebar.ejs +2 -2
  50. package/layout/post.ejs +19 -3
  51. package/package.json +4 -5
  52. package/scripts/event/welcome.js +6 -7
  53. package/scripts/helper/charts.js +45 -34
  54. package/scripts/helper/randomLinks.js +1 -1
  55. package/scripts/helper/related_post.js +11 -4
  56. package/scripts/helper/themeJsExport.js +12 -10
  57. package/scripts/tags/fold.js +2 -3
  58. package/scripts/tags/note.js +6 -2
  59. package/scripts/tags/tabs.js +2 -2
  60. package/source/css/main.css +79 -265
  61. package/source/css/search/algolia-search.css +1 -1
  62. package/source/css/search/local-search.css +1 -1
  63. package/source/css/var.css +3 -0
  64. package/source/img/default.png +0 -0
  65. package/source/img/error_load.png +0 -0
  66. package/source/img/logo-horizontal_version.png +0 -0
  67. package/source/img/pwa/16.png +0 -0
  68. package/source/img/pwa/180.png +0 -0
  69. package/source/img/pwa/192.png +0 -0
  70. package/source/img/pwa/32.png +0 -0
  71. package/source/img/pwa/512.png +0 -0
  72. package/source/img/pwa/logo.png +0 -0
  73. package/source/img/pwa/siteicon/splash-1125x2436.png +0 -0
  74. package/source/img/pwa/siteicon/splash-1136x640.png +0 -0
  75. package/source/img/pwa/siteicon/splash-1170x2532.png +0 -0
  76. package/source/img/pwa/siteicon/splash-1179x2556.png +0 -0
  77. package/source/img/pwa/siteicon/splash-1242x2208.png +0 -0
  78. package/source/img/pwa/siteicon/splash-1242x2688.png +0 -0
  79. package/source/img/pwa/siteicon/splash-1248x2778.png +0 -0
  80. package/source/img/pwa/siteicon/splash-1290x2796.png +0 -0
  81. package/source/img/pwa/siteicon/splash-1334x750.png +0 -0
  82. package/source/img/pwa/siteicon/splash-1536x2048.png +0 -0
  83. package/source/img/pwa/siteicon/splash-1620x2160.png +0 -0
  84. package/source/img/pwa/siteicon/splash-1668x2224.png +0 -0
  85. package/source/img/pwa/siteicon/splash-1668x2388.png +0 -0
  86. package/source/img/pwa/siteicon/splash-1792x828.png +0 -0
  87. package/source/img/pwa/siteicon/splash-2048x1536.png +0 -0
  88. package/source/img/pwa/siteicon/splash-2048x2732.png +0 -0
  89. package/source/img/pwa/siteicon/splash-2160x1620.png +0 -0
  90. package/source/img/pwa/siteicon/splash-2208x1242.png +0 -0
  91. package/source/img/pwa/siteicon/splash-2224x1668.png +0 -0
  92. package/source/img/pwa/siteicon/splash-2388x1668.png +0 -0
  93. package/source/img/pwa/siteicon/splash-2436x1125.png +0 -0
  94. package/source/img/pwa/siteicon/splash-2532x1170.png +0 -0
  95. package/source/img/pwa/siteicon/splash-2556x1179.png +0 -0
  96. package/source/img/pwa/siteicon/splash-2688x1242.png +0 -0
  97. package/source/img/pwa/siteicon/splash-2732x2048.png +0 -0
  98. package/source/img/pwa/siteicon/splash-2778x1248.png +0 -0
  99. package/source/img/pwa/siteicon/splash-2796x1290.png +0 -0
  100. package/source/img/pwa/siteicon/splash-640x1136.png +0 -0
  101. package/source/img/pwa/siteicon/splash-750x1334.png +0 -0
  102. package/source/img/pwa/siteicon/splash-828x1792.png +0 -0
  103. package/source/img/solitude-show.jpg +0 -0
  104. package/source/js/commentBarrage.js +145 -136
  105. package/source/js/extend/covercolor/local.js +104 -94
  106. package/source/js/extend/search/algolia-search.js +11 -0
  107. package/source/js/extend/search/local-search.js +12 -1
  108. package/source/js/main.js +212 -27
  109. package/source/js/rightmenu.js +402 -0
  110. package/source/js/txmap.js +236 -0
  111. package/source/lib/chuckle-post-ai.js +1 -0
  112. package/source/lib/circle.min.js +1 -0
  113. package/source/lib/friends_post.js +4 -98
  114. package/source/lib/snackbar.min.js +9 -0
  115. package/source/lib/view-image.min.js +6 -0
  116. package/scripts/filter/katex.js +0 -25
  117. package/scripts/tags/expand.js +0 -4
  118. package/source/img/power.png +0 -0
  119. package/source/js/circle.js +0 -1828
  120. package/source/js/extend/covercolor/web.js +0 -137
  121. package/source/js/post_ai.js +0 -517
  122. package/source/lib/snackbar.js +0 -16
  123. package/source/lib/view-image.js +0 -13
  124. /package/source/lib/{bundle.js → bundle.min.js} +0 -0
  125. /package/source/lib/{lazyload.js → lazyload.min.js} +0 -0
@@ -8,11 +8,11 @@
8
8
  <%= page.cc %>
9
9
  </a>
10
10
  <% if (page.categories.data.length) { %>
11
- <span class="post-meta-categories">
12
- <% page.categories.data.forEach(item => { %>
13
- <a class="post-meta-categories" href="<%= url_for(item.path) %>"><%= item.name %></a>
14
- <% }) %>
15
- </span>
11
+ <span class="post-meta-categories">
12
+ <% page.categories.data.forEach(item => { %>
13
+ <a class="post-meta-categories" href="<%= url_for(item.path) %>"><%= item.name %></a>
14
+ <% }) %>
15
+ </span>
16
16
  <% } %>
17
17
  <div class="tag_share">
18
18
  <div class="post-meta__tag-list">
@@ -29,55 +29,57 @@
29
29
  <h1 class="post-title"><%= page.title %></h1>
30
30
  <div id="post-meta">
31
31
  <div class="meta-secondline">
32
- <span class="post-meta-date" title="发布于">
33
- <i class="post-meta-icon ri-calendar-todo-fill"></i>
32
+ <% if(theme.post.meta.date){ %>
33
+ <span class="post-meta-date" title="发布于">
34
+ <i class="post-meta-icon scoicon sco-calendar-todo-fill"></i>
34
35
  <time datetime="<%= moment(page.date).format() %>"></time>
35
36
  </span>
37
+ <% } %>
36
38
  <% if(theme.post.meta.updated){ %>
37
39
  <span class="post-meta-date" title="更新于">
38
- <i class="post-meta-icon ri-refresh-line"></i>
40
+ <i class="post-meta-icon scoicon sco-refresh-line"></i>
39
41
  <time datetime="<%= moment(page.updated).format() %>"></time>
40
42
  </span>
41
43
  <% } %>
42
44
  <% if(theme.post.meta.locate){ %>
43
45
  <span class="post-meta-position" title="作者IP归属地为<%= page.locate %>">
44
- <i class="post-meta-icon ri-map-pin-fill"></i>
46
+ <i class="post-meta-icon scoicon sco-map-pin-fill"></i>
45
47
  <span><%= page.locate %></span>
46
48
  </span>
47
49
  <% } %>
48
50
  <% if(theme.thirdparty.wordcount){ %>
49
51
  <% if(theme.post.meta.wordcount){ %>
50
52
  <span class="post-meta-wordcount">
51
- <i class="ri-file-word-fill post-meta-icon" title="文章字数"></i>
53
+ <i class="scoicon sco-word-fill post-meta-icon" title="文章字数"></i>
52
54
  <span class="word-count"><%= wordcount(page.content) %></span>
53
55
  </span>
54
56
  <% } %>
55
57
  <% if(theme.post.meta.readtime){ %>
56
58
  <span class="post-meta-time">
57
- <i class="ri-time-fill post-meta-icon" title="阅读耗时"></i>
59
+ <i class="scoicon sco-clock-fill post-meta-icon" title="阅读耗时"></i>
58
60
  <span><%= min2read(page.content) %> min</span>
59
61
  </span>
60
62
  <% } %>
61
63
  <% } %>
62
64
  <% if(theme.thirdparty.busuanzi.enable && theme.post.meta.pv){ %>
63
65
  <span class="post-meta-pv" title="文章热度">
64
- <i class="ri-fire-fill post-meta-icon"></i>
66
+ <i class="scoicon sco-fire-fill post-meta-icon"></i>
65
67
  <% if(theme.thirdparty.busuanzi.usecomment){ %>
66
- <span id="twikoo_visitors"><i class="ri-loader-2-fill"></i></span>
68
+ <span id="twikoo_visitors"><i class="scoicon sco-loading-line"></i></span>
67
69
  <% }else{ %>
68
- <span id="busuanzi_value_page_pv"><i class="ri-loader-2-fill"></i></span>
69
- <% } %>
70
+ <span id="busuanzi_value_page_pv"><i class="scoicon sco-loading-line"></i></span>
71
+ <% } %>
70
72
  </span>
71
73
  <% } %>
72
74
  <% if(theme.post.meta.comment && page.comment){ %>
73
75
  <span class="post-meta-commentcount" title="评论数">
74
- <i class="ri-message-fill"></i>
76
+ <i class="scoicon sco-chat-fill"></i>
75
77
  <a href="#post-comment">
76
- <span id="twikoo-count"><i class="ri-loader-2-fill"></i></span>
78
+ <span id="twikoo-count"><i class="scoicon sco-loading-line"></i></span>
77
79
  </a>
78
80
  </span>
79
- <% } %>
81
+ <% } %>
80
82
  </div>
81
83
  </div>
82
84
  </div>
83
- <%- partial('partial/compoment/post/wave', {cache: true}) %>
85
+ <%- partial('partial/compoment/post/wave', {cache: true}) %>
@@ -1,18 +1,18 @@
1
1
  <div class="bber-bottom">
2
2
  <div class="bber-info">
3
3
  <div class="bber-info-time">
4
- <i class="ri-time-fill"></i>
4
+ <i class="scoicon sco-calendar-todo-fill"></i>
5
5
  <time class="datetime" datetime="<%= moment(item.date).format() %>"></time>
6
6
  </div>
7
7
  <% if(item.link){ %>
8
8
  <a class="bber-content-link" href="<%= url_for(item.link) %>" title="跳转到短文指引的链接">
9
- <i class="ri-link-m"></i>
9
+ <i class="scoicon sco-link-m-line"></i>
10
10
  链接
11
11
  </a>
12
12
  <% } %>
13
13
  </div>
14
14
  <a class="bber-reply" onclick="sco.toTalk('<%- item.content %>')" >
15
- <i class="ri-message-3-fill" style="font-size: 1rem;">
15
+ <i class="scoicon sco-chat-fill" style="font-size: 1rem;">
16
16
  </i>
17
17
  </a>
18
18
  </div>
@@ -5,7 +5,6 @@
5
5
  <% item.image.forEach(img => { %>
6
6
  <img src="<%= img %>" title="即刻短文配图">
7
7
  <% }); %>
8
- </a>
9
8
  </div>
10
9
  <% } %>
11
10
  </div>
@@ -0,0 +1,15 @@
1
+ <% if(item.aplayer){ %>
2
+ <div class="bber-music">
3
+ <meting-js server="<%= item.aplayer.server %>" type="song" id="<%= item.aplayer.id %>" mutex="true" preload="none" theme="var(--sco-main)" data-lrctype="0"></meting-js>
4
+ </div>
5
+ <% } %>
6
+ <% if(item.video){ %>
7
+ <div class="bber-video">
8
+ <% if(item.video.player){ %>
9
+ <video src="<%= item.video.player %>" controls="controls" style="object-fit: cover;"></video>
10
+ <% } %>
11
+ <% if(item.video.bilibili){ %>
12
+ <iframe src="<%= item.video.bilibili %>" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>
13
+ <% } %>
14
+ </div>
15
+ <% } %>
@@ -1,7 +1,7 @@
1
1
  <div id="post-comment" view-image>
2
2
  <div class="comment-head">
3
3
  <div class="comment-headline">
4
- <i class="scoicon ri-message-fill"></i>
4
+ <i class="scoicon sco-chat-fill"></i>
5
5
  <span> 评论</span>
6
6
  </div>
7
7
  </div>
@@ -6,7 +6,8 @@
6
6
  el: '#comment',
7
7
  onCommentLoaded: function() {
8
8
  GLOBALCONFIG.lightbox && sco.lightbox('#article-container img, #twikoo .tk-content img:not(.tk-owo-emotion)')
9
- }
9
+ },
10
+ lang: '<%= theme.comment.twikoo.lang %>',
10
11
  }
11
12
  )
12
13
  await twikoo.init(initOptions)
@@ -3,7 +3,7 @@
3
3
  <nav class="search-nav">
4
4
  <span class="search-dialog-title">搜索</span>
5
5
  <button class="search-close-button">
6
- <i class="ri-time-fill"></i>
6
+ <i class="scoicon sco-close-fill"></i>
7
7
  </button>
8
8
  </nav>
9
9
  <div class="search-wrap">
@@ -12,7 +12,7 @@
12
12
  <div id="algolia-hits">
13
13
  </div>
14
14
  <div class="algolia-stats"></div>
15
- <div class="algolia-poweredBy" style="display: none"></div>
15
+ <div class="algolia-poweredBy"></div>
16
16
  </div>
17
17
  </div>
18
18
  </div>
@@ -3,11 +3,11 @@
3
3
  <nav class="search-nav">
4
4
  <span class="search-dialog-title">搜索</span>
5
5
  <button class="search-close-button">
6
- <i class="ri-time-fill"></i>
6
+ <i class="scoicon sco-close-fill"></i>
7
7
  </button>
8
8
  </nav>
9
9
  <div id="loading-database">
10
- <i class="ri-loader-2-fill"></i>
10
+ <i class="scoicon sco-loading-line"></i>
11
11
  <span>加载中</span>
12
12
  </div>
13
13
  <div class="search-wrap">
@@ -1,6 +1,6 @@
1
1
  <div id="console" style="zoom: 1;" class="">
2
2
  <div class="close-btn" onclick="sco.hideConsole()" href="javascript:void(0);">
3
- <i class="ri-close-fill"></i>
3
+ <i class="scoicon sco-close-fill"></i>
4
4
  </div>
5
5
  <% if(theme.thirdparty.consolePlus){ %>
6
6
  <div class="console-card-group">
@@ -39,13 +39,19 @@
39
39
  <div class="console-btn-item">
40
40
  <a class="darkmode_switchbutton" onclick="sco.switchDarkMode()" title="显示模式切换"
41
41
  href="javascript:void(0);" rel="external nofollow" data-pjax-state="">
42
- <i class="ri-contrast-2-fill" style="font-size: 1rem;"></i>
42
+ <i class="scoicon sco-moon-clear-fill" style="font-size: 1rem;"></i>
43
+ </a>
44
+ </div>
45
+ <div class="console-btn-item" id="consoleHideAside">
46
+ <a class="asideSwitch" onclick="sco.switchHideAside()" title="边栏显示控制"
47
+ href="javascript:void(0);" rel="external nofollow" data-pjax-state="">
48
+ <i class="scoicon sco-side-bar-fill" style="font-size: 1rem;"></i>
43
49
  </a>
44
50
  </div>
45
51
  <% if(theme.thirdparty.aplayer.enable){ %>
46
52
  <div class="console-btn-item" id="consoleMusic" onclick="sco.musicToggle()" title="音乐开关">
47
53
  <a class="music-switch">
48
- <i class="ri-disc-fill"></i>
54
+ <i class="scoicon sco-disc-fill"></i>
49
55
  </a>
50
56
  </div>
51
57
  <% } %>
@@ -53,7 +59,7 @@
53
59
  <div class="console-btn-item on" id="consoleCommentBarrage" onclick="sco.switchCommentBarrage()"
54
60
  title="热评开关">
55
61
  <a class="commentBarrage">
56
- <i class="ri-message-3-fill"></i>
62
+ <i class="scoicon sco-chat-fill"></i>
57
63
  </a>
58
64
  </div>
59
65
  <% }%>
@@ -44,7 +44,7 @@
44
44
  <div class="footer-title-group">
45
45
  <h3 class="footer-title">友链</h3>
46
46
  <a class="random-friends-btn" href="javascript:randomLinksList();" rel="external nofollow">
47
- <i class="ri-refresh-line"></i>
47
+ <i class="scoicon sco-refresh-line"></i>
48
48
  </a>
49
49
  </div>
50
50
  <div class="footer-links" id="friend-links-in-footer">
@@ -83,10 +83,10 @@
83
83
  </a>
84
84
  <% } %>
85
85
  <a class="footer-bar-link cc" href="<%- theme.footer.license.url %>" target="_self" rel="external nofollow">
86
- <i class="ri-copyright-line"></i>
87
- <i class="ri-creative-commons-by-line"></i>
88
- <i class="ri-creative-commons-nc-line"></i>
89
- <i class="ri-creative-commons-nd-line"></i>
86
+ <i class="scoicon sco-copyright-line"></i>
87
+ <i class="scoicon sco-creative-commons-by-line"></i>
88
+ <i class="scoicon sco-creative-commons-nc-line"></i>
89
+ <i class="scoicon sco-creative-commons-nd-line"></i>
90
90
  </a>
91
91
  </div>
92
92
  </div>
@@ -96,12 +96,14 @@
96
96
  <div class="cookies-window-content">
97
97
  <span class="cookies-tip">查看本站为你的个人隐私做出的努力</span>
98
98
  <a class="cookies-link" href="/privacy/" title="本站如何保护你的隐私" data-pjax-state="">
99
- <i class="heofont icon-arrow-right-circle-fill"></i>
99
+ <i class="scoicon sco-arrow-right-circle-fill"></i>
100
100
  </a>
101
101
  </div>
102
102
  </div>
103
- <div class="comment-barrage">
104
- </div>
103
+ <% if(theme.post.award.enable){%>
104
+ <div id="quit-box" onclick="RemoveRewardMask()" style="display: none"></div>
105
+ <%} %>
105
106
  <% if(theme.comment.enable){ %>
106
- <%- js('/js/commentBarrage') %>
107
+ <div class="comment-barrage">
108
+ </div>
107
109
  <% } %>
@@ -3,7 +3,7 @@
3
3
  <div id="blog_name">
4
4
  <% if(theme.nav.left.enable){ %>
5
5
  <div class="back-home-button" tabindex="-1">
6
- <i class="back-home-button-icon scoicon ri-apps-fill"></i>
6
+ <i class="back-home-button-icon scoicon sco-more-fill"></i>
7
7
  <%- partial('partial/compoment/nav/left') %>
8
8
  </div>
9
9
  <% } %>
@@ -11,7 +11,7 @@
11
11
  <% if (theme.site.name.class === 'i_class') { %>
12
12
  <i class="<%= theme.site.name.custom %>" style="font-size: 16px;"></i>
13
13
  <% } else if (theme.site.name.class === 'img') { %>
14
- <i style="background-image: url('<%= url_for(theme.site.name.custom) %>')"></i>
14
+ <img src="<%= url_for(theme.site.name.custom) %>"></img>
15
15
  <% } else if (theme.site.name.class === 'text') { %>
16
16
  <span class="scoicon"><%= theme.site.name.custom %></span>
17
17
  <% } %>
@@ -5,7 +5,7 @@
5
5
  <div class="sidebar-menu-item">
6
6
  <a class="darkmode_switchbutton menu-child" onclick="sco.switchDarkMode()" title="显示模式切换"
7
7
  href="javascript:void(0);" rel="external nofollow">
8
- <i class="scoicon ri-contrast-2-fill" style="font-size: 1rem;"></i>
8
+ <i class="scoicon sco-moon-clear-fill" style="font-size: 1rem;"></i>
9
9
  <span>显示模式</span>
10
10
  </a>
11
11
  </div>
@@ -16,7 +16,7 @@
16
16
  <span class="sidebar-menu-item-title">标签</span>
17
17
  <div class="card-widget card-tags card-archives card-webinfo card-allinfo">
18
18
  <div class="item-headline">
19
- <i class="scoicon ri-price-tag-3-fill"></i>
19
+ <i class="scoicon sco-price-tag-fill"></i>
20
20
  <span>标签</span>
21
21
  </div>
22
22
  <div class="card-tag-cloud">
package/layout/post.ejs CHANGED
@@ -19,7 +19,9 @@
19
19
  </div>
20
20
  </div>
21
21
 
22
- <%- partial('partial/compoment/post/postNav') %>
22
+ <% if(site.posts.length > 1){ %>
23
+ <%- partial('partial/compoment/post/postNav') %>
24
+ <% } %>
23
25
 
24
26
  <%- related_posts(page, site.posts) %>
25
27
 
@@ -30,7 +32,21 @@
30
32
 
31
33
  <%- partial('partial/compoment/aside/aside') %>
32
34
 
33
- <% if(theme.ai.enable){ %>
34
- <script type="text/javascript" src="/js/post_ai.js"></script>
35
+ <% if(theme.thirdparty.ai.enable){ %>
36
+ <script data-pjax defer>
37
+ // AI构造函数
38
+ new ChucklePostAI({
39
+ /* 必须配置 */
40
+ // 文章内容所在的元素属性的选择器,也是AI挂载的容器,AI将会挂载到该容器的最前面
41
+ el: '#post #article-container',
42
+ // 驱动AI所必须的key,即是tianliGPT后端服务所必须的key
43
+ key: '<%= theme.thirdparty.ai.key %>',
44
+ /* 非必须配置,但最好根据自身需要进行配置 */
45
+ // 文章标题所在的元素属性的选择器,默认获取当前网页的标题
46
+ title_el: '.post-title',
47
+ // 文章推荐方式,all:匹配数据库内所有文章进行推荐,web:仅当前站内的文章,默认all
48
+ rec_method: '<%= theme.thirdparty.ai.rec_method || 'web' %>',
49
+ })
50
+ </script>
35
51
  <% } %>
36
52
  </main>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hexo-theme-solitude",
3
- "version": "1.0.0",
4
- "description": "A beautiful, powerful, and efficient Hexo theme developed by the hexo-theme-Solitude team",
3
+ "version": "1.1.3",
4
+ "description": "A beautiful, powerful, and efficient Hexo theme developed by the DuoSco team",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
7
7
  },
@@ -14,11 +14,10 @@
14
14
  "theme",
15
15
  "hexo-theme-solitude"
16
16
  ],
17
- "author": "Hexo-Theme-Solitude <wleelw@sondy.top>",
17
+ "author": "Hexo-Theme-Solitude<admin@wzsco.top>",
18
18
  "license": "MIT",
19
19
  "bugs": {
20
20
  "url": "https://github.com/DuoSco/Hexo-theme-solitude/issues"
21
21
  },
22
- "homepage": "https://github.com/DuoSco/hexo-theme-solitude#readme",
23
- "main": "index.js"
22
+ "homepage": "https://github.com/DuoSco/hexo-theme-solitude#readme"
24
23
  }
@@ -2,14 +2,13 @@ hexo.on('ready', () => {
2
2
  const { version } = require('../../package.json')
3
3
  hexo.log.info(`
4
4
  ===================================================================
5
- ##### # # #### ##### ###### ## #####
6
- # # # # # # # # # # # # #
7
- ##### # # # ##### ###### # # ######
8
- # # # # # ### # # # ###### # #
9
- # # # # # # # # # # # # #
10
- ##### #### ### ##### ###### # # # #
5
+ ##### #### # ##### ###### # # ###### ######
6
+ # # # # # # # # # # #
7
+ ##### # # # # # # # # # ######
8
+ # # # # # # # # # # #
9
+ ###### #### ##### ##### # ### ###### ######
11
10
  ${version}
12
11
  ===================================================================
13
12
  主题链接:https://github.com/DuoSco/Hexo-theme-solitude
14
- 主题开发:王卓Sco`)
13
+ `)
15
14
  })
@@ -1,38 +1,41 @@
1
- const cheerio = require('cheerio')
2
- const moment = require('moment')
3
-
4
1
  hexo.extend.filter.register('after_render:html', function (locals) {
5
- const $ = cheerio.load(locals)
6
- const post = $('#posts-chart')
7
- const tag = $('#tags-chart')
8
- const category = $('#categories-chart')
9
- const htmlEncode = false
2
+ try {
3
+ const cheerio = require('cheerio')
4
+ const $ = cheerio.load(locals)
5
+ const post = $('#posts-chart')
6
+ const tag = $('#tags-chart')
7
+ const category = $('#categories-chart')
8
+ const htmlEncode = false
10
9
 
11
- if (post.length > 0 || tag.length > 0 || category.length > 0) {
12
- if (post.length > 0 && $('#postsChart').length === 0) {
13
- if (post.attr('data-encode') === 'true') htmlEncode = true
14
- post.after(postsChart(post.attr('data-start')))
15
- }
16
- if (tag.length > 0 && $('#tagsChart').length === 0) {
17
- if (tag.attr('data-encode') === 'true') htmlEncode = true
18
- tag.after(tagsChart(tag.attr('data-length')))
19
- }
20
- if (category.length > 0 && $('#categoriesChart').length === 0) {
21
- if (category.attr('data-encode') === 'true') htmlEncode = true
22
- category.after(categoriesChart(category.attr('data-parent')))
23
- }
10
+ if (post.length > 0 || tag.length > 0 || category.length > 0) {
11
+ if (post.length > 0 && $('#postsChart').length === 0) {
12
+ if (post.attr('data-encode') === 'true') htmlEncode = true
13
+ post.after(postsChart(post.attr('data-start')))
14
+ }
15
+ if (tag.length > 0 && $('#tagsChart').length === 0) {
16
+ if (tag.attr('data-encode') === 'true') htmlEncode = true
17
+ tag.after(tagsChart(tag.attr('data-length')))
18
+ }
19
+ if (category.length > 0 && $('#categoriesChart').length === 0) {
20
+ if (category.attr('data-encode') === 'true') htmlEncode = true
21
+ category.after(categoriesChart(category.attr('data-parent')))
22
+ }
24
23
 
25
- if (htmlEncode) {
26
- return $.root().html().replace(/&amp;#/g, '&#')
24
+ if (htmlEncode) {
25
+ return $.root().html().replace(/&amp;#/g, '&#')
26
+ } else {
27
+ return $.root().html()
28
+ }
27
29
  } else {
28
- return $.root().html()
30
+ return locals
29
31
  }
30
- } else {
31
- return locals
32
+ } catch (e) {
33
+
32
34
  }
33
35
  }, 15)
34
36
 
35
- function postsChart (startMonth) {
37
+ function postsChart(startMonth) {
38
+ const moment = require('moment')
36
39
  const startDate = moment(startMonth || '2020-01')
37
40
  const endDate = moment()
38
41
 
@@ -164,12 +167,14 @@ function postsChart (startMonth) {
164
167
  </script>`
165
168
  }
166
169
 
167
- function tagsChart (len) {
170
+ function tagsChart(len) {
168
171
  const tagArr = []
169
172
  hexo.locals.get('tags').map(function (tag) {
170
- tagArr.push({ name: tag.name, value: tag.length, path: tag.path })
173
+ tagArr.push({name: tag.name, value: tag.length, path: tag.path})
174
+ })
175
+ tagArr.sort((a, b) => {
176
+ return b.value - a.value
171
177
  })
172
- tagArr.sort((a, b) => { return b.value - a.value })
173
178
 
174
179
  const dataLength = Math.min(tagArr.length, len) || tagArr.length
175
180
  const tagNameArr = []
@@ -285,7 +290,7 @@ function tagsChart (len) {
285
290
  </script>`
286
291
  }
287
292
 
288
- function categoriesChart (dataParent) {
293
+ function categoriesChart(dataParent) {
289
294
  const categoryArr = []
290
295
  let categoryParentFlag = false
291
296
  hexo.locals.get('categories').map(function (category) {
@@ -299,8 +304,11 @@ function categoriesChart (dataParent) {
299
304
  })
300
305
  })
301
306
  categoryParentFlag = categoryParentFlag && dataParent === 'true'
302
- categoryArr.sort((a, b) => { return b.value - a.value })
303
- function translateListToTree (data, parent) {
307
+ categoryArr.sort((a, b) => {
308
+ return b.value - a.value
309
+ })
310
+
311
+ function translateListToTree(data, parent) {
304
312
  let tree = []
305
313
  let temp
306
314
  data.forEach((item, index) => {
@@ -316,7 +324,10 @@ function categoriesChart (dataParent) {
316
324
  })
317
325
  return tree
318
326
  }
319
- const categoryNameJson = JSON.stringify(categoryArr.map(function (category) { return category.name }))
327
+
328
+ const categoryNameJson = JSON.stringify(categoryArr.map(function (category) {
329
+ return category.name
330
+ }))
320
331
  const categoryArrJson = JSON.stringify(categoryArr)
321
332
  const categoryArrParentJson = JSON.stringify(translateListToTree(categoryArr, '0'))
322
333
 
@@ -12,5 +12,5 @@ hexo.extend.helper.register('randomLinks', function(){
12
12
  })
13
13
  }
14
14
  });
15
- return `<script>const links=${JSON.stringify(links)};function travelling(){const link=links[utils.randomNum(links.length)];utils.snackbarShow('您即将前往 ⌈ '+link.name+' ⌋ , 安全性未知',false,3000);setTimeout(()=>{window.open(link.link,"_blank")},3000)};function randomLinksList(){let data='';for(let i=1;i<=3;i++){const link=links[utils.randomNum(links.length)];data+='<a class="footer-item" href="'+link.link+'" target="_blank" rel="noopener nofollow">'+link.name+'</a>'};document.getElementById('friend-links-in-footer').innerHTML=data + '<a class="footer-item" href="/links/">更多</a>'};</script>`
15
+ return `<script>const links=${JSON.stringify(links)};function travelling(){const link=links[utils.randomNum(links.length)];utils.snackbarShow('您即将前往 ⌈ '+link.name+' ⌋ , 安全性未知',false,3000);setTimeout(()=>{window.open(link.link,"_blank")},3000)};function randomLinksList(){let data='';let linksCopy = [...links];let count = Math.min(3, linksCopy.length);for (let i = 0; i < count; i++) {let index = utils.randomNum(linksCopy.length);const link = linksCopy[index];data += '<a class="footer-item" href="' + link.link + '" target="_blank" rel="noopener nofollow">' + link.name + '</a>';linksCopy.splice(index, 1);}document.getElementById('friend-links-in-footer').innerHTML = data + '<a class="footer-item" href="/links/">更多</a>';};</script>`
16
16
  })
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Butterfly
2
+ * Solitude
3
3
  * Related Posts
4
4
  * According the tag
5
5
  */
@@ -42,11 +42,11 @@ hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
42
42
  const dateType = config.related_post.date_type || 'created'
43
43
  const headlineLang = this._p('喜欢这篇的人也看了')
44
44
 
45
- relatedPosts = relatedPosts.sort(compare('weight'))
45
+ relatedPosts = relatedPosts.sort(compare('weight', dateType))
46
46
 
47
47
  if (relatedPosts.length > 0) {
48
48
  result += '<div class="relatedPosts">'
49
- result += `<div class="headline"><i class="ri-star-smile-fill"></i><span>${headlineLang}</span><div class="relatedPosts-link"><a onclick="event.preventDefault(); toRandomPost();" href="javascript:void(0);" rel="external nofollow" data-pjax-state="">随便逛逛</a></div></div>`
49
+ result += `<div class="headline"><i class="scoicon sco-star-smile-fill"></i><span>${headlineLang}</span><div class="relatedPosts-link"><a onclick="event.preventDefault(); toRandomPost();" href="javascript:void(0);" rel="external nofollow" data-pjax-state="">随便逛逛</a></div></div>`
50
50
  result += '<div class="relatedPosts-list">'
51
51
 
52
52
  for (let i = 0; i < Math.min(relatedPosts.length, limitNum); i++) {
@@ -82,10 +82,17 @@ function findItem(arrayToSearch, attr, val) {
82
82
  return -1
83
83
  }
84
84
 
85
- function compare(attr) {
85
+ function compare(attr, dateType) {
86
86
  return function (a, b) {
87
87
  const val1 = a[attr]
88
88
  const val2 = b[attr]
89
+ if (val1 === val2) {
90
+ if (dateType === 'created') {
91
+ return b.created - a.created
92
+ } else if (dateType === 'updated') {
93
+ return b.updated - a.updated
94
+ }
95
+ }
89
96
  return val2 - val1
90
97
  }
91
98
  }
@@ -1,5 +1,5 @@
1
- hexo.extend.helper.register('export_config', function() {
2
- const { config, theme } = this, lang = hexo.theme.i18n.get(config.language || 'zh-CN')
1
+ hexo.extend.helper.register('export_config', function () {
2
+ const {config, theme} = this, lang = hexo.theme.i18n.get(config.language || 'zh-CN')
3
3
  let exportGlobalConfig = {
4
4
  root: config.root,
5
5
  runtime: theme.aside.siteinfo.runtimeenable ? theme.aside.siteinfo.runtime : false,
@@ -47,17 +47,19 @@ hexo.extend.helper.register('export_config', function() {
47
47
  covercolor: theme.post.covercolor.enable,
48
48
  comment: {
49
49
  enable: theme.comment.enable,
50
- twikooUrl: theme.comment.twikoo.envId
51
-
52
- }
50
+ twikooUrl: theme.comment.twikoo.envId,
51
+ twikooAccessToken: theme.comment.twikoo.accessToken
52
+ },
53
53
  }
54
54
 
55
55
  // 搜索数据
56
- if(theme.thirdparty.search.local_search.enable)exportGlobalConfig = Object.assign(exportGlobalConfig, {localsearch: {
57
- preload: theme.thirdparty.search.local_search.preload,
58
- path: theme.thirdparty.search.local_search.path || '/search.xml'
59
- }})
60
- if(theme.thirdparty.search.algolia_search.enable)exportGlobalConfig = Object.assign(exportGlobalConfig, {
56
+ if (theme.thirdparty.search.local_search.enable) exportGlobalConfig = Object.assign(exportGlobalConfig, {
57
+ localsearch: {
58
+ preload: theme.thirdparty.search.local_search.preload,
59
+ path: theme.thirdparty.search.local_search.path || '/search.xml'
60
+ }
61
+ })
62
+ if (theme.thirdparty.search.algolia_search.enable) exportGlobalConfig = Object.assign(exportGlobalConfig, {
61
63
  algolia: {
62
64
  appId: config.algolia.appId,
63
65
  apiKey: config.algolia.apiKey,
@@ -7,10 +7,9 @@
7
7
 
8
8
  function postTabs(args, content) {
9
9
  const title = args[0] ? args[0] : ""
10
- const date = args[1] ? args[1] : ""
11
- const open = args[2] ? args[2] : ""
10
+ const open = args[1] ? args[1] : ""
12
11
 
13
- return `<details ${open}><summary>${title + " " + date}</summary><div class="content">${hexo.render.renderSync({
12
+ return `<details ${open}><summary>${title}</summary><div class="content">${hexo.render.renderSync({
14
13
  text: content,
15
14
  engine: 'markdown'
16
15
  })}</div></details>`
@@ -1,3 +1,7 @@
1
- hexo.extend.tag.register('note', function(type, content){
2
- return `<div class="note ${type}">${hexo.render.renderSync({ text: content, engine: 'markdown' })}</div>`
1
+ hexo.extend.tag.register('note', function (types, content) {
2
+ let type = ""
3
+ for (let i = 0; i < types.length; i++) {
4
+ type += " " + types[i]
5
+ }
6
+ return `<div class="note ${type}">${hexo.render.renderSync({text: content, engine: 'markdown'})}</div>`
3
7
  }, {ends: true});