hexo-theme-solitude 1.3.0 → 1.4.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/.github/FUNDING.yml +13 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +107 -0
- package/.github/ISSUE_TEMPLATE/config.yml +13 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +14 -0
- package/.github/workflows/npm-publish.yml +21 -0
- package/CONTRIBUTING.md +0 -0
- package/LICENSE +0 -0
- package/README.md +60 -43
- package/README_EN.md +60 -42
- package/_config.yml +606 -444
- package/languages/en-US.yml +3 -23
- package/languages/zh-CN.yml +3 -23
- package/layout/404.pug +0 -0
- package/layout/archive.pug +2 -3
- package/layout/category.pug +0 -0
- package/layout/includes/body/mode.pug +35 -0
- package/layout/includes/console.pug +3 -3
- package/layout/includes/footer.pug +16 -15
- package/layout/includes/head/config.pug +38 -30
- package/layout/includes/head/opengraph.pug +0 -0
- package/layout/includes/head/pwa.pug +5 -44
- package/layout/includes/head.pug +3 -1
- package/layout/includes/header.pug +0 -0
- package/layout/includes/inject/body.pug +115 -63
- package/layout/includes/inject/head.pug +11 -46
- package/layout/includes/layout.pug +1 -1
- package/layout/includes/loading.pug +0 -0
- package/layout/includes/mixins/articleSort.pug +0 -0
- package/layout/includes/mixins/pagination.pug +0 -0
- package/layout/includes/nav.pug +1 -1
- package/layout/includes/page/about.pug +1 -1
- package/layout/includes/page/categories.pug +0 -0
- package/layout/includes/page/default.pug +0 -0
- package/layout/includes/page/equipment.pug +0 -0
- package/layout/includes/page/links.pug +2 -2
- package/layout/includes/page/music.pug +0 -0
- package/layout/includes/page/not_configured.pug +0 -0
- package/layout/includes/page/rss.pug +3 -3
- package/layout/includes/page/says.pug +15 -15
- package/layout/includes/page/tags.pug +0 -0
- package/layout/includes/page/tlink.pug +1 -0
- package/layout/includes/recent-posts.pug +0 -0
- package/layout/includes/sidebar.pug +0 -0
- package/layout/includes/widgets/aside/aside.pug +6 -6
- package/layout/includes/widgets/aside/asideAllInfo.pug +0 -0
- package/layout/includes/widgets/aside/asideArchive.pug +0 -0
- package/layout/includes/widgets/aside/asideCustom.pug +1 -1
- package/layout/includes/widgets/aside/asideFlipCard.pug +0 -0
- package/layout/includes/widgets/aside/asideInfoCard.pug +3 -3
- package/layout/includes/widgets/aside/asideNewestPost.pug +0 -0
- package/layout/includes/widgets/aside/asideSwitch.pug +0 -4
- package/layout/includes/widgets/aside/asideTag.pug +1 -1
- package/layout/includes/widgets/aside/asideToc.pug +0 -0
- package/layout/includes/widgets/aside/asideWebInfo.pug +2 -2
- package/layout/includes/widgets/home/banner.pug +0 -0
- package/layout/includes/widgets/home/bb/json.pug +22 -0
- package/layout/includes/widgets/home/bb/local.pug +17 -0
- package/layout/includes/widgets/home/bb/memos.pug +25 -0
- package/layout/includes/widgets/home/bbTimeList.pug +11 -7
- package/layout/includes/widgets/home/categoryBar.pug +0 -0
- package/layout/includes/widgets/home/categoryGroup.pug +1 -1
- package/layout/includes/widgets/home/hometop.pug +0 -0
- package/layout/includes/widgets/home/postList.pug +0 -0
- package/layout/includes/widgets/home/topGroup.pug +0 -0
- package/layout/includes/widgets/nav/left.pug +0 -0
- package/layout/includes/widgets/nav/menu.pug +1 -1
- package/layout/includes/widgets/nav/right.pug +6 -5
- package/layout/includes/widgets/page/about/authorinfo.pug +10 -9
- package/layout/includes/widgets/page/about/award.pug +0 -0
- package/layout/includes/widgets/page/about/contentinfo.pug +35 -34
- package/layout/includes/widgets/page/about/hobbies.pug +21 -17
- package/layout/includes/widgets/page/about/motto.pug +17 -16
- package/layout/includes/widgets/page/about/other.pug +16 -16
- package/layout/includes/widgets/page/about/personalities.pug +15 -14
- package/layout/includes/widgets/page/about/skillsinfo.pug +37 -36
- package/layout/includes/widgets/page/about/tenyear.pug +0 -0
- package/layout/includes/widgets/page/banner.pug +9 -3
- package/layout/includes/widgets/page/equipment/content.pug +0 -0
- package/layout/includes/widgets/page/links/banner.pug +14 -12
- package/layout/includes/widgets/page/links/linksCard.pug +4 -6
- package/layout/includes/widgets/page/links/linksDiscn.pug +8 -0
- package/layout/includes/widgets/page/links/linksItem.pug +4 -6
- package/layout/includes/widgets/page/says/json.pug +80 -0
- package/layout/includes/widgets/page/says/local.pug +48 -0
- package/layout/includes/widgets/page/says/memos.pug +109 -0
- package/layout/includes/widgets/post/award.pug +0 -0
- package/layout/includes/widgets/post/copyright.pug +2 -2
- package/layout/includes/widgets/post/post-ai.pug +12 -0
- package/layout/includes/widgets/post/postMeta.pug +2 -2
- package/layout/includes/widgets/post/postNav.pug +0 -0
- package/layout/includes/widgets/post/wave.pug +0 -0
- package/layout/includes/widgets/randomlink.pug +1 -1
- package/layout/includes/widgets/rightside/index.pug +6 -5
- package/layout/includes/widgets/third-party/comments/comment.pug +1 -5
- package/layout/includes/widgets/third-party/comments/twikoo.pug +1 -1
- package/layout/includes/widgets/third-party/comments/waline.pug +9 -11
- package/layout/includes/widgets/third-party/music.pug +1 -1
- package/layout/includes/widgets/third-party/news-comment/newest-comment.pug +6 -0
- package/layout/includes/widgets/third-party/news-comment/twikoo.pug +70 -0
- package/layout/includes/widgets/third-party/news-comment/waline.pug +64 -0
- package/layout/includes/widgets/third-party/pjax.pug +0 -0
- package/layout/includes/widgets/third-party/search/algolia-search.pug +0 -0
- package/layout/includes/widgets/third-party/search/index.pug +8 -7
- package/layout/includes/widgets/third-party/search/local-search.pug +0 -0
- package/layout/index.pug +3 -3
- package/layout/page.pug +0 -4
- package/layout/post.pug +2 -2
- package/layout/tag.pug +0 -0
- package/package.json +18 -9
- package/plugins.yml +109 -0
- package/scripts/event/cdn.js +129 -0
- package/scripts/event/init.js +0 -0
- package/scripts/event/page.js +1 -21
- package/scripts/event/welcome.js +1 -1
- package/scripts/filter/checkThemeConfig.js +0 -0
- package/scripts/filter/default.js +0 -0
- package/scripts/filter/lazyload.js +1 -1
- package/scripts/filter/randomPosts.js +0 -0
- package/scripts/helper/cdn.js +0 -0
- package/scripts/helper/getArchiveLength.js +0 -0
- package/scripts/helper/page.js +0 -0
- package/scripts/helper/related_post.js +0 -0
- package/scripts/helper/stylus.js +0 -0
- package/scripts/tags/button.js +0 -0
- package/scripts/tags/bvideo.js +0 -0
- package/scripts/tags/card.js +0 -0
- package/scripts/tags/checkbox.js +0 -0
- package/scripts/tags/fold.js +0 -0
- package/scripts/tags/image.js +0 -0
- package/scripts/tags/inline-image.js +0 -0
- package/scripts/tags/label.js +0 -0
- package/scripts/tags/link.js +0 -0
- package/scripts/tags/media.js +0 -0
- package/scripts/tags/note.js +0 -0
- package/scripts/tags/span.js +0 -0
- package/scripts/tags/tabs.js +0 -0
- package/scripts/tags/timeline.js +0 -0
- package/scripts/tags/u.js +0 -0
- package/source/css/_global/animation.css +0 -0
- package/source/css/_global/function.styl +42 -42
- package/source/css/_global/index.styl +1 -1
- package/source/css/_global/var.styl +0 -0
- package/source/css/_layout/basic.styl +10 -12
- package/source/css/_layout/header.styl +8 -3
- package/source/css/_layout/index.styl +59 -5
- package/source/css/_mode/index.styl +0 -0
- package/source/css/_page/_home/category-bar.styl +0 -0
- package/source/css/_page/_home/home-top.styl +10 -31
- package/source/css/_page/_home/index.styl +0 -0
- package/source/css/_page/_home/pagination.styl +3 -0
- package/source/css/_page/_home/recent-post.styl +10 -3
- package/source/css/_page/about/index.styl +0 -0
- package/source/css/_page/about/tenyear.styl +0 -0
- package/source/css/_page/about.styl +9 -0
- package/source/css/_page/category.styl +0 -0
- package/source/css/_page/douban.styl +0 -1
- package/source/css/_page/equipment.styl +0 -0
- package/source/css/_page/error.styl +0 -0
- package/source/css/_page/home.styl +0 -0
- package/source/css/_page/index.styl +2 -3
- package/source/css/_page/links.styl +85 -49
- package/source/css/_page/moment.styl +0 -0
- package/source/css/_page/music.styl +1 -1
- package/source/css/_page/rss.styl +0 -0
- package/source/css/_page/says.styl +10 -0
- package/source/css/_page/tag.styl +0 -0
- package/source/css/_widgets/_aside/allinfo.styl +34 -0
- package/source/css/_widgets/_aside/flip.styl +0 -0
- package/source/css/_widgets/_aside/index.styl +1 -7
- package/source/css/_widgets/_aside/info.styl +0 -0
- package/source/css/_widgets/_aside/newPost.styl +0 -0
- package/source/css/_widgets/_aside/toc.styl +0 -0
- package/source/css/_widgets/_aside/welcome.styl +0 -0
- package/source/css/_widgets/_comment/index.styl +0 -0
- package/source/css/_widgets/_comment/twikoo.styl +0 -2
- package/source/css/_widgets/_comment/waline.styl +0 -0
- package/source/css/_widgets/_extra/console.styl +0 -0
- package/source/css/_widgets/_extra/fullpage.styl +0 -0
- package/source/css/_widgets/_extra/music.styl +1 -1
- package/source/css/_widgets/_extra/pace.styl +0 -0
- package/source/css/_widgets/_extra/rightmenu.styl +0 -0
- package/source/css/_widgets/_mixins/article-sort.styl +0 -0
- package/source/css/_widgets/_mixins/footer.styl +1 -2
- package/source/css/_widgets/_mixins/other.styl +0 -4
- package/source/css/_widgets/_mixins/sidebar.styl +0 -0
- package/source/css/_widgets/_post/_highlight/diff.styl +0 -0
- package/source/css/_widgets/_post/_highlight/index.styl +0 -1
- package/source/css/_widgets/_post/_highlight/theme/default.styl +0 -0
- package/source/css/_widgets/_post/_highlight/theme/mac.styl +0 -0
- package/source/css/_widgets/_post/_highlight/theme.styl +0 -0
- package/source/css/_widgets/_post/commentBarrage.styl +0 -0
- package/source/css/_widgets/_post/content.styl +42 -11
- package/source/css/_widgets/_post/copyright.styl +0 -0
- package/source/css/_widgets/_post/index.styl +1 -1
- package/source/css/_widgets/_post/meta.styl +0 -3
- package/source/css/_widgets/_post/pagination.styl +1 -1
- package/source/css/_widgets/_post/postAI.styl +0 -0
- package/source/css/_widgets/_post/relatedPost.styl +0 -0
- package/source/css/_widgets/_post/tools.styl +0 -0
- package/source/css/_widgets/_search/algolia-search.styl +0 -0
- package/source/css/_widgets/_search/local-search.styl +0 -0
- package/source/css/_widgets/_tags/button.styl +0 -0
- package/source/css/_widgets/_tags/bvideo.styl +0 -0
- package/source/css/_widgets/_tags/card.styl +0 -0
- package/source/css/_widgets/_tags/checkbox.styl +0 -0
- package/source/css/_widgets/_tags/fold.styl +0 -0
- package/source/css/_widgets/_tags/image.styl +0 -0
- package/source/css/_widgets/_tags/index.styl +0 -0
- package/source/css/_widgets/_tags/inline-image.styl +0 -0
- package/source/css/_widgets/_tags/label.styl +0 -0
- package/source/css/_widgets/_tags/link.styl +4 -2
- package/source/css/_widgets/_tags/note.styl +0 -0
- package/source/css/_widgets/_tags/span.styl +0 -0
- package/source/css/_widgets/_tags/tabs.styl +0 -0
- package/source/css/_widgets/_tags/timeline.styl +0 -1
- package/source/css/_widgets/index.styl +4 -4
- package/source/css/index.styl +0 -0
- package/source/img/avatar.png +0 -0
- package/source/img/default.png +0 -0
- package/source/img/error_load.png +0 -0
- package/source/js/{extend/comment/twikoo/commentBarrage.js → comment/twikoo_commentBarrage.js} +0 -0
- package/source/js/{extend/comment/waline/commentBarrage.js → comment/waline_commentBarrage.js} +0 -0
- package/source/js/covercolor/api.js +95 -0
- package/source/js/covercolor/local.js +154 -0
- package/source/js/main.js +28 -252
- package/source/js/music.js +0 -0
- package/source/js/rightside.js +404 -0
- package/source/js/{extend/search/algolia-search.js → search/algolia.js} +10 -0
- package/source/js/{extend/search/local-search.js → search/local.js} +24 -2
- package/source/js/utils.js +75 -1
- package/layout/includes/head/fest.pug +0 -22
- package/layout/includes/page/echarts.pug +0 -7
- package/layout/includes/page/moments.pug +0 -4
- package/layout/includes/widgets/aside/asideHistory.pug +0 -8
- package/layout/includes/widgets/aside/asideWelcome.pug +0 -12
- package/layout/includes/widgets/page/moments/angle.pug +0 -19
- package/layout/includes/widgets/page/moments/index.pug +0 -23
- package/layout/includes/widgets/page/says/saysBottom.pug +0 -11
- package/layout/includes/widgets/page/says/saysContent.pug +0 -6
- package/layout/includes/widgets/page/says/saysFunction.pug +0 -10
- package/layout/includes/widgets/page/says/saysMeta.pug +0 -7
- package/layout/includes/widgets/third-party/ai/index.pug +0 -12
- package/layout/includes/widgets/third-party/comments/gitalk.pug +0 -0
- package/layout/includes/widgets/third-party/comments/valine.pug +0 -0
- package/scripts/helper/echarts.js +0 -407
- package/source/css/_widgets/_aside/history.styl +0 -42
- package/source/js/extend/comment/twikoo/twikoo.js +0 -67
- package/source/js/extend/comment/waline/waline.js +0 -60
- package/source/lib/bundle.min.js +0 -27
- package/source/lib/circle.min.js +0 -1
- package/source/lib/cover-color.min.js +0 -7
- package/source/lib/friends_post.js +0 -4
- package/source/lib/lazyload.min.js +0 -1
- package/source/lib/rightside.min.js +0 -1
- package/source/lib/snackbar.min.css +0 -1
- package/source/lib/snackbar.min.js +0 -9
- package/source/lib/txmap.min.js +0 -1
- package/source/lib/view-image.min.js +0 -6
- package/source/lib/waterfall.min.js +0 -1
- /package/source/{lib → js}/sco-ai.min.js +0 -0
@@ -0,0 +1,109 @@
|
|
1
|
+
case theme.says.style
|
2
|
+
when 1
|
3
|
+
script.
|
4
|
+
!async function () {
|
5
|
+
let say_strip = !{theme.says.strip};
|
6
|
+
let aplayerRegex = /{aplayer,(.*?),(.*?)}/g;
|
7
|
+
let linkRegex = /(?<!\!)\[([^\]]*)\]\(([^\)]*)\)/g;
|
8
|
+
let bilibiliRegex = /{bilibili,(.*?)}/g;
|
9
|
+
let playerRegex = /{player,(.*?)}/g;
|
10
|
+
let imageRegex = /!\[\]\((.*?)\)/g;
|
11
|
+
let contentRegex = /#.*?\s([^{\n]*)/g
|
12
|
+
|
13
|
+
await fetch("!{url_for(theme.says.mode_link)}")
|
14
|
+
.then(res => res.json())
|
15
|
+
.then(data => {
|
16
|
+
let list = say_strip === -1 || say_strip >= data.length ? data : data.slice(0, say_strip);
|
17
|
+
let aplayer = null;
|
18
|
+
let video = null;
|
19
|
+
let imageBox = null;
|
20
|
+
|
21
|
+
document.querySelector('#waterfall').innerHTML = list.map(item => {
|
22
|
+
aplayer = item.content.match(aplayerRegex);
|
23
|
+
aplayer = aplayer ? `<div class="bber-music"><meting-js server="${aplayer[0].replace(aplayerRegex, '$1')}" type="song" id="${aplayer[0].replace(aplayerRegex, '$2')}" mutex="true" preload="none" theme="var(--sco-main)" data-lrctype="0"></meting-js></div>` : null;
|
24
|
+
video = item.content.match(playerRegex);
|
25
|
+
video = video ? `<div class="bber-video"><video src="${video[0].replace(playerRegex, '$1')}" controls="controls" style="object-fit: cover;"></video></div>` : item.content.match(bilibiliRegex);
|
26
|
+
video = item.content.match(bilibiliRegex) ? `<div class="bber-video"><iframe src="//player.bilibili.com/player.html?autoplay=0&bvid=${video[0].replace(bilibiliRegex, '$1')}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe></div>` : video;
|
27
|
+
imageBox = item.content.match(imageRegex);
|
28
|
+
imageBox = imageBox ? `<div class="bber-content-img">${imageBox.map(img => `<img src="${img.replace(imageRegex, '$1')}" title="即刻短文配图" />`).join('')}</div>` : '';
|
29
|
+
let time = new Date(item.createdTs * 1000).toISOString().replace('Z', '+08:00');
|
30
|
+
let content = item.content.match(contentRegex).map(item => item.replace(contentRegex, '$1'));
|
31
|
+
let link = item.content.match(linkRegex);
|
32
|
+
link = link ? `<a class="bber-content-link" href='${link[0].replace(linkRegex, '$2')}' title="${link[0].replace(linkRegex, '$1')}" target="_blank"><i class="scoicon sco-link-m-line"></i>链接</a>` : '';
|
33
|
+
return `<li class="item">
|
34
|
+
<div id="bber-content">
|
35
|
+
<p class="datacont">${content}</p>
|
36
|
+
${imageBox || ''}
|
37
|
+
</div>
|
38
|
+
${video || ''}
|
39
|
+
${aplayer || ''}
|
40
|
+
<hr>
|
41
|
+
<div class="bber-bottom">
|
42
|
+
<div class="bber-info">
|
43
|
+
<div class="bber-info-time">
|
44
|
+
<i class="scoicon sco-calendar-todo-fill"></i>
|
45
|
+
<time class="datetime" datetime="${time}"></time>
|
46
|
+
</div>
|
47
|
+
${link}
|
48
|
+
</div>
|
49
|
+
${content ? `<a class="bber-reply goComment" onclick="sco.toTalk('${content}')"><i class="scoicon sco-chat-fill" style="font-size: 1rem;"></i></a>` : ''}
|
50
|
+
</div>
|
51
|
+
</li>`;
|
52
|
+
}).join('');
|
53
|
+
}).catch(error => console.log(error));
|
54
|
+
sco.reflashEssayWaterFall();
|
55
|
+
GLOBAL_CONFIG.lazyload.enable && utils.lazyloadImg();
|
56
|
+
GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll(".bber-content-img img"));
|
57
|
+
changeTimeFormat();
|
58
|
+
}();
|
59
|
+
when 2
|
60
|
+
script.
|
61
|
+
!async function () {
|
62
|
+
let say_strip = !{theme.says.strip};
|
63
|
+
let aplayerRegex = /{aplayer,(.*?),(.*?)}/g;
|
64
|
+
let bilibiliRegex = /{bilibili,(.*?)}/g;
|
65
|
+
let playerRegex = /{player,(.*?)}/g;
|
66
|
+
let imageRegex = /!\[\]\((.*?)\)/g;
|
67
|
+
let contentRegex = /#.*?\s([^{\n]*)/g
|
68
|
+
|
69
|
+
await fetch("!{url_for(theme.says.mode_link)}")
|
70
|
+
.then(res => res.json())
|
71
|
+
.then(data => {
|
72
|
+
let list = say_strip === -1 || say_strip >= data.length ? data : data.slice(0, say_strip);
|
73
|
+
let aplayer = null;
|
74
|
+
let video = null;
|
75
|
+
let imageBox = null;
|
76
|
+
|
77
|
+
document.querySelector('#waterfall').innerHTML = list.map(item => {
|
78
|
+
aplayer = item.content.match(aplayerRegex);
|
79
|
+
aplayer = aplayer ? `<div class="bber-music"><meting-js server="${aplayer[0].replace(aplayerRegex, '$1')}" type="song" id="${aplayer[0].replace(aplayerRegex, '$2')}" mutex="true" preload="none" theme="var(--sco-main)" data-lrctype="0"></meting-js></div>` : null;
|
80
|
+
video = item.content.match(playerRegex);
|
81
|
+
video = video ? `<div class="bber-video"><video src="${video[0].replace(playerRegex, '$1')}" controls="controls" style="object-fit: cover;"></video></div>` : item.content.match(bilibiliRegex);
|
82
|
+
video = item.content.match(bilibiliRegex) ? `<div class="bber-video"><iframe src="//player.bilibili.com/player.html?autoplay=0&bvid=${video[0].replace(bilibiliRegex, '$1')}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe></div>` : video;
|
83
|
+
imageBox = item.content.match(imageRegex);
|
84
|
+
imageBox = imageBox ? `<div class="bber-content-img">${imageBox.map(img => `<img src="${img.replace(imageRegex, '$1')}" title="即刻短文配图" />`).join('')}</div>` : '';
|
85
|
+
let time = new Date(item.createdTs * 1000).toISOString().replace('Z', '+08:00');
|
86
|
+
let content = item.content.match(contentRegex).map(item => item.replace(contentRegex, '$1'));
|
87
|
+
return `<li class="item">
|
88
|
+
<div class="meta">
|
89
|
+
<img class="no-lightbox no-lazyload avatar" src="!{theme.aside.card.author.img}">
|
90
|
+
<div class="info">
|
91
|
+
<span class="bber_nick">#{config.author}</span>
|
92
|
+
<time class="datetime bber_date" datetime="${time}"></time>
|
93
|
+
</div>
|
94
|
+
${content ? `<a class="bber-reply goComment" onclick="sco.toTalk('${content}')"><i class="scoicon sco-chat-fill" style="font-size: 1rem;"></i></a>` : ''}
|
95
|
+
</div>
|
96
|
+
<div id="bber-content">
|
97
|
+
<p class="datacont">${content}</p>
|
98
|
+
${imageBox || ''}
|
99
|
+
</div>
|
100
|
+
${video || ''}
|
101
|
+
${aplayer || ''}
|
102
|
+
</li>`;
|
103
|
+
}).join('');
|
104
|
+
sco.reflashEssayWaterFall();
|
105
|
+
GLOBAL_CONFIG.lazyload.enable && utils.lazyloadImg();
|
106
|
+
GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll(".bber-content-img img"));
|
107
|
+
changeTimeFormat();
|
108
|
+
}).catch(error => console.log(error));
|
109
|
+
}();
|
File without changes
|
@@ -11,9 +11,9 @@
|
|
11
11
|
#quit-box(onclick="RemoveRewardMask()")
|
12
12
|
if theme.post.award.enable
|
13
13
|
include ./award
|
14
|
-
if theme.post.rss
|
14
|
+
if theme.post.rss
|
15
15
|
.reward-link.mode
|
16
|
-
a.reward-link-button(href=url_for(theme.post.rss
|
16
|
+
a.reward-link-button(href=url_for(theme.post.rss), title="订阅")
|
17
17
|
i.scoicon.sco-plant-fill
|
18
18
|
| 订阅
|
19
19
|
if theme.post.default.copyright.enable || page.copyright
|
@@ -0,0 +1,12 @@
|
|
1
|
+
.post-ai
|
2
|
+
.ai-title
|
3
|
+
.ai-title-left
|
4
|
+
i.ai-title-icon.scoicon.sco-robot-fill
|
5
|
+
.ai-title-text 文章摘要
|
6
|
+
.ai-tag#ai-tag= theme.post_ai.modelName
|
7
|
+
.ai-explanation(style="display: block;")
|
8
|
+
.ai-suggestions
|
9
|
+
.ai-bottom
|
10
|
+
.ai-tips= theme.post_ai.tips
|
11
|
+
if theme.post_ai.report
|
12
|
+
a.ai-report(title="投诉", href=url_for(theme.post_ai.report)) 投诉
|
@@ -24,7 +24,7 @@
|
|
24
24
|
span.post-meta-date(title=_p('meta_updated') + ' ' + full_date(page.updated))
|
25
25
|
i.post-meta-icon.scoicon.sco-refresh-line
|
26
26
|
time(datetime=date_xml(page.updated))= date_xml(page.updated)
|
27
|
-
if theme.
|
27
|
+
if theme.wordcount
|
28
28
|
span.post-meta-wordcount
|
29
29
|
if theme.post.meta.wordcount
|
30
30
|
i.post-meta-icon.scoicon.sco-word-fill(title=_p('post.meta_wordcount'))
|
@@ -48,7 +48,7 @@
|
|
48
48
|
when "waline"
|
49
49
|
span.waline-pageview-count
|
50
50
|
i.scoicon.sco-loading-line
|
51
|
-
else if theme.
|
51
|
+
else if theme.busuanzi
|
52
52
|
span#busuanzi_value_page_pv
|
53
53
|
i.scoicon.sco-loading-line
|
54
54
|
if theme.post.meta.comment && page.comment
|
File without changes
|
File without changes
|
@@ -29,7 +29,7 @@ if theme.footer.randomlink
|
|
29
29
|
for (let i = 0; i < count; i++) {
|
30
30
|
let index = utils.randomNum(linksCopy.length);
|
31
31
|
const {link, name} = linksCopy[index];
|
32
|
-
data += `<a class="footer-item" href="${link}">${name}</a>`;
|
32
|
+
data += `<a class="footer-item" href="${link}" target="_blank" rel="noopener noreferrer nofollow">${name}</a>`;
|
33
33
|
linksCopy.splice(index, 1);
|
34
34
|
}
|
35
35
|
|
@@ -15,9 +15,10 @@ div#rightMenu
|
|
15
15
|
div.rightMenu-item#menu-pastetext
|
16
16
|
i.scoicon.sco-clipboard-fill
|
17
17
|
span 粘贴文本
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
if theme.comment.enable
|
19
|
+
a.rightMenu-item#menu-commenttext
|
20
|
+
i.scoicon.sco-chat-new-fill
|
21
|
+
span 引用到评论
|
21
22
|
div.rightMenu-item#menu-newwindow
|
22
23
|
i.scoicon.sco-window-fill
|
23
24
|
span 新窗口打开
|
@@ -45,7 +46,7 @@ div#rightMenu
|
|
45
46
|
div.rightMenu-item#menu-music-forward
|
46
47
|
i.scoicon.sco-skip-forward-fill
|
47
48
|
span 切换到下一首
|
48
|
-
div.rightMenu-item#menu-music-playlist(onclick=`window.open('${theme.
|
49
|
+
div.rightMenu-item#menu-music-playlist(onclick=`window.open('${theme.capsule.server === 'tencent' ? `https://y.qq.com/n/ryqq/playlist/${theme.capsule.id}` : `https://music.163.com/#/playlist?id=${theme.capsule.id}`}', '_blank');`)
|
49
50
|
i.scoicon.sco-play-list-2-line
|
50
51
|
span 查看所有歌曲
|
51
52
|
div.rightMenu-item#menu-music-copyMusicName
|
@@ -71,5 +72,5 @@ div#rightMenu
|
|
71
72
|
span.menu-commentBarrage-text 关闭热评
|
72
73
|
div.rightMenu-item#menu-darkmode
|
73
74
|
i.scoicon.sco-moon-clear-fill
|
74
|
-
span.menu-darkmode-text
|
75
|
+
span.menu-darkmode-text 深色模式
|
75
76
|
div#rightmenu-mask
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#post-comment
|
1
|
+
#post-comment
|
2
2
|
.comment-head
|
3
3
|
.comment-headline
|
4
4
|
i.scoicon.sco-chat-fill
|
@@ -13,9 +13,5 @@
|
|
13
13
|
case theme.comment.type
|
14
14
|
when 'twikoo'
|
15
15
|
include ./twikoo.pug
|
16
|
-
when 'gitalk'
|
17
|
-
include ./gitalk.pug
|
18
|
-
when 'valine'
|
19
|
-
include ./valine.pug
|
20
16
|
when 'waline'
|
21
17
|
include ./waline.pug
|
@@ -5,7 +5,7 @@ script.
|
|
5
5
|
{
|
6
6
|
el: '#comment',
|
7
7
|
onCommentLoaded: function () {
|
8
|
-
GLOBAL_CONFIG.lightbox &&
|
8
|
+
GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll('#twikoo .tk-content img:not(.tk-owo-emotion)'))
|
9
9
|
},
|
10
10
|
lang: '#{theme.comment.twikoo.lang}',
|
11
11
|
}
|
@@ -2,15 +2,13 @@
|
|
2
2
|
|
3
3
|
script.
|
4
4
|
async function initComment() {
|
5
|
-
((
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
}, !{JSON.stringify(option)}))
|
15
|
-
})()
|
5
|
+
Waline.init(Object.assign({
|
6
|
+
el: '#comment',
|
7
|
+
serverURL: '!{envId}',
|
8
|
+
pageview: !{theme.post.meta.pv},
|
9
|
+
dark: 'html[data-theme="dark"]',
|
10
|
+
path: window.location.pathname,
|
11
|
+
search: false,
|
12
|
+
comment: #{theme.post.meta.comment && is_post()},
|
13
|
+
}, !{JSON.stringify(option)}))
|
16
14
|
}
|
@@ -1,3 +1,3 @@
|
|
1
1
|
div.needEndHide#nav-music(onclick="sco.musicToggle()")
|
2
2
|
div#nav-music-hoverTips=__('music.hit')
|
3
|
-
meting-js(id=theme.
|
3
|
+
meting-js(id=theme.capsule.id, server=theme.capsule.server, type="playlist", mutex="true", preload="none", data-lrctype="0", order="random", theme="var(--sco-main)")
|
@@ -0,0 +1,70 @@
|
|
1
|
+
script.
|
2
|
+
window.addEventListener('load', () => {
|
3
|
+
const changeContent = (content) => {
|
4
|
+
if (content === '') return content;
|
5
|
+
|
6
|
+
const replacements = [
|
7
|
+
{regex: /<img.*?src="(.*?)"?[^\>]+>/ig, replacement: '[图片]'},
|
8
|
+
{regex: /<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, replacement: '[链接]'},
|
9
|
+
{regex: /<pre><code>.*?<\/pre>/gi, replacement: '[代码]'},
|
10
|
+
{regex: /<[^>]+>/g, replacement: ""}
|
11
|
+
];
|
12
|
+
|
13
|
+
content = replacements.reduce((str, {regex, replacement}) => str.replace(regex, replacement), content);
|
14
|
+
|
15
|
+
return content.length > 150 ? content.substring(0, 150) + '...' : content;
|
16
|
+
}
|
17
|
+
|
18
|
+
const getComment = () => {
|
19
|
+
const $dom = document.querySelector('#card-newest-comments .aside-list')
|
20
|
+
|
21
|
+
const runTwikoo = () => {
|
22
|
+
twikoo.getRecentComments({
|
23
|
+
envId: GLOBAL_CONFIG.comment.twikoo.url,
|
24
|
+
region: '',
|
25
|
+
pageSize: 6,
|
26
|
+
includeReply: true
|
27
|
+
}).then(function (res) {
|
28
|
+
const twikooArray = res.map(e => ({
|
29
|
+
'content': changeContent(e.comment),
|
30
|
+
'avatar': e.avatar,
|
31
|
+
'nick': e.nick,
|
32
|
+
'url': `${e.url}#${e.id}`,
|
33
|
+
'date': new Date(e.created).toISOString()
|
34
|
+
}))
|
35
|
+
generateHtml(twikooArray)
|
36
|
+
}).catch(function (err) {
|
37
|
+
$dom.innerHTML = "无法获取评论,请确认相关配置是否正确"
|
38
|
+
})
|
39
|
+
}
|
40
|
+
runTwikoo()
|
41
|
+
}
|
42
|
+
|
43
|
+
const generateHtml = array => {
|
44
|
+
const $dom = document.querySelector('#card-newest-comments .aside-list')
|
45
|
+
$dom.innerHTML = array.length ? array.map(item => `
|
46
|
+
<div class='aside-list-item'>
|
47
|
+
<a href='${item.url}' class='thumbnail'>
|
48
|
+
<img src='${item.avatar}' alt='${item.nick}'>
|
49
|
+
<div class='name'><span>${item.nick}</span></div>
|
50
|
+
</a>
|
51
|
+
<div class='content'>
|
52
|
+
<a class='comment' href='${item.url}'>${item.content}</a>
|
53
|
+
<time class="datetime" datetime="${item.date}"></time>
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
`).join('') : '没有评论'
|
57
|
+
window.lazyLoadInstance && window.lazyLoadInstance.update()
|
58
|
+
window.pjax && window.pjax.refresh($dom)
|
59
|
+
changeTimeFormat()
|
60
|
+
}
|
61
|
+
|
62
|
+
const newestCommentInit = () => {
|
63
|
+
const $asideList = document.querySelector('#card-newest-comments .aside-list')
|
64
|
+
if ($asideList) {
|
65
|
+
getComment()
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
newestCommentInit()
|
70
|
+
})
|
@@ -0,0 +1,64 @@
|
|
1
|
+
script.
|
2
|
+
window.addEventListener('load', () => {
|
3
|
+
const changeContent = (content) => {
|
4
|
+
if (content === '') return content;
|
5
|
+
|
6
|
+
const replacements = [
|
7
|
+
{regex: /<img.*?src="(.*?)"?[^\>]+>/ig, replacement: '[图片]'},
|
8
|
+
{regex: /<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, replacement: '[链接]'},
|
9
|
+
{regex: /<pre><code>.*?<\/pre>/gi, replacement: '[代码]'},
|
10
|
+
{regex: /<[^>]+>/g, replacement: ""}
|
11
|
+
];
|
12
|
+
|
13
|
+
content = replacements.reduce((str, {regex, replacement}) => str.replace(regex, replacement), content);
|
14
|
+
|
15
|
+
return content.length > 150 ? content.substring(0, 150) + '...' : content;
|
16
|
+
}
|
17
|
+
|
18
|
+
const $asideList = document.querySelector('#card-newest-comments .aside-list')
|
19
|
+
const newestCommentInit = () => {
|
20
|
+
if ($asideList) {
|
21
|
+
getComment()
|
22
|
+
}
|
23
|
+
}
|
24
|
+
const getComment = () => {
|
25
|
+
Waline.RecentComments(
|
26
|
+
options = {
|
27
|
+
serverURL: GLOBAL_CONFIG.comment.waline.url,
|
28
|
+
count: 6,
|
29
|
+
}
|
30
|
+
).then(function (res) {
|
31
|
+
const walineArray = res.comments.map(item => ({
|
32
|
+
'content': changeContent(item.comment),
|
33
|
+
'avatar': item.avatar,
|
34
|
+
'nick': item.nick,
|
35
|
+
'url': `${item.url}#${item.objectId}`,
|
36
|
+
'date': new Date(item.insertedAt).toISOString()
|
37
|
+
}))
|
38
|
+
generateHtml(walineArray)
|
39
|
+
}).catch(
|
40
|
+
$asideList.innerHTML = "无法获取评论,请确认相关配置是否正确"
|
41
|
+
)
|
42
|
+
}
|
43
|
+
|
44
|
+
const generateHtml = array => {
|
45
|
+
const $dom = document.querySelector('#card-newest-comments .aside-list')
|
46
|
+
$dom.innerHTML = array.length ? array.map(item => `
|
47
|
+
<div class='aside-list-item'>
|
48
|
+
<a href='${item.url}' class='thumbnail'>
|
49
|
+
<img src='${item.avatar}' alt='${item.nick}'>
|
50
|
+
<div class='name'><span>${item.nick}</span></div>
|
51
|
+
</a>
|
52
|
+
<div class='content'>
|
53
|
+
<a class='comment' href='${item.url}'>${item.content}</a>
|
54
|
+
<time class="datetime" datetime="${item.date}"></time>
|
55
|
+
</div>
|
56
|
+
</div>
|
57
|
+
`).join('') : '没有评论'
|
58
|
+
window.lazyLoadInstance && window.lazyLoadInstance.update()
|
59
|
+
window.pjax && window.pjax.refresh($dom)
|
60
|
+
changeTimeFormat()
|
61
|
+
}
|
62
|
+
|
63
|
+
newestCommentInit()
|
64
|
+
})
|
File without changes
|
File without changes
|
@@ -1,7 +1,8 @@
|
|
1
|
-
if theme.
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
if theme.search.enable
|
2
|
+
case theme.search.type
|
3
|
+
when 'algolia'
|
4
|
+
include algolia-search
|
5
|
+
script(src=url_for(theme.cdn.algolia_js))
|
6
|
+
when 'local'
|
7
|
+
include local-search
|
8
|
+
script(src=url_for(theme.cdn.local_search))
|
File without changes
|
package/layout/index.pug
CHANGED
@@ -2,9 +2,9 @@ extends includes/layout.pug
|
|
2
2
|
|
3
3
|
block content
|
4
4
|
#home_top
|
5
|
-
if
|
6
|
-
include ./includes/widgets/home/bbTimeList
|
7
|
-
if
|
5
|
+
if theme.says.home_mini
|
6
|
+
include ./includes/widgets/home/bbTimeList
|
7
|
+
if theme.hometop.banner.enable && is_home_first_page()
|
8
8
|
include ./includes/widgets/home/hometop.pug
|
9
9
|
main.layout#content-inner
|
10
10
|
.recent-posts#recent-posts
|
package/layout/page.pug
CHANGED
@@ -18,10 +18,6 @@ block content
|
|
18
18
|
include includes/page/says
|
19
19
|
when 'equipment'
|
20
20
|
include includes/page/equipment
|
21
|
-
when 'moments'
|
22
|
-
include includes/page/moments
|
23
|
-
when 'echarts'
|
24
|
-
include includes/page/echarts
|
25
21
|
when 'rss'
|
26
22
|
include includes/page/rss
|
27
23
|
when 'douban'
|
package/layout/post.pug
CHANGED
@@ -3,8 +3,8 @@ extends includes/layout.pug
|
|
3
3
|
block content
|
4
4
|
main.layout#content-inner
|
5
5
|
#post
|
6
|
-
if theme.
|
7
|
-
include includes/widgets/
|
6
|
+
if theme.post_ai.enable
|
7
|
+
include includes/widgets/post/post-ai
|
8
8
|
article.post-content#article-container!= page.content
|
9
9
|
include includes/widgets/post/copyright
|
10
10
|
.post-tools-right
|
package/layout/tag.pug
CHANGED
File without changes
|
package/package.json
CHANGED
@@ -1,23 +1,32 @@
|
|
1
1
|
{
|
2
2
|
"name": "hexo-theme-solitude",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.4.0",
|
4
4
|
"description": "A beautiful, powerful, and efficient Hexo theme developed by the DuoSco team",
|
5
|
+
"main": "package.json",
|
5
6
|
"scripts": {
|
6
7
|
"test": "echo \"Error: no test specified\" && exit 1"
|
7
8
|
},
|
8
|
-
"repository": {
|
9
|
-
"type": "git",
|
10
|
-
"url": "git+https://github.com/DuoSco/hexo-theme-solitude.git"
|
11
|
-
},
|
12
9
|
"keywords": [
|
13
10
|
"hexo",
|
14
11
|
"theme",
|
12
|
+
"solitude",
|
13
|
+
"Card UI Design",
|
14
|
+
"Wleelw",
|
15
15
|
"hexo-theme-solitude"
|
16
16
|
],
|
17
|
-
"
|
18
|
-
|
17
|
+
"repository": {
|
18
|
+
"type": "git",
|
19
|
+
"url": "https://github.com/wleelw/hexo-theme-solitude.git"
|
20
|
+
},
|
21
|
+
"dependencies": {
|
22
|
+
"hexo-renderer-stylus": "^3.0.0",
|
23
|
+
"hexo-renderer-pug": "^3.0.0"
|
24
|
+
},
|
19
25
|
"bugs": {
|
20
|
-
"url": "https://github.com/
|
26
|
+
"url": "https://github.com/wleelw/hexo-theme-solitude/issues",
|
27
|
+
"email": "me@wzsco.top"
|
21
28
|
},
|
22
|
-
"homepage": "https://
|
29
|
+
"homepage": "https://blog.wzsco.top/",
|
30
|
+
"author": "Hexo-Theme-Solitude<me@wzsco.top>",
|
31
|
+
"license": "GNU"
|
23
32
|
}
|
package/plugins.yml
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
algolia_search:
|
2
|
+
name: algoliasearch
|
3
|
+
file: dist/algoliasearch-lite.umd.js
|
4
|
+
version: 4.22.0
|
5
|
+
instantsearch:
|
6
|
+
name: instantsearch.js
|
7
|
+
file: dist/instantsearch.production.min.js
|
8
|
+
version: 4.63.0
|
9
|
+
pjax:
|
10
|
+
name: pjax
|
11
|
+
file: pjax.min.js
|
12
|
+
version: 0.2.8
|
13
|
+
twikoo:
|
14
|
+
name: twikoo
|
15
|
+
file: dist/twikoo.all.min.js
|
16
|
+
version: 1.6.29
|
17
|
+
waline_js:
|
18
|
+
name: '@waline/client'
|
19
|
+
file: dist/waline.js
|
20
|
+
other_name: waline
|
21
|
+
version: 2.15.8
|
22
|
+
waline_css:
|
23
|
+
name: '@waline/client'
|
24
|
+
file: dist/waline.css
|
25
|
+
other_name: waline
|
26
|
+
version: 2.15.8
|
27
|
+
sharejs:
|
28
|
+
name: butterfly-extsrc
|
29
|
+
file: sharejs/dist/js/social-share.min.js
|
30
|
+
version: 1.1.3
|
31
|
+
sharejs_css:
|
32
|
+
name: butterfly-extsrc
|
33
|
+
file: sharejs/dist/css/share.min.css
|
34
|
+
version: 1.1.3
|
35
|
+
katex:
|
36
|
+
name: katex
|
37
|
+
file: dist/katex.min.css
|
38
|
+
other_name: KaTeX
|
39
|
+
version: 0.16.9
|
40
|
+
katex_copytex:
|
41
|
+
name: katex
|
42
|
+
file: dist/contrib/copy-tex.min.js
|
43
|
+
other_name: KaTeX
|
44
|
+
version: 0.16.9
|
45
|
+
lazyload:
|
46
|
+
name: vanilla-lazyload
|
47
|
+
file: dist/lazyload.iife.min.js
|
48
|
+
version: 17.8.5
|
49
|
+
aplayer_css:
|
50
|
+
name: aplayer
|
51
|
+
file: dist/APlayer.min.css
|
52
|
+
version: 1.10.1
|
53
|
+
aplayer_js:
|
54
|
+
name: aplayer
|
55
|
+
file: dist/APlayer.min.js
|
56
|
+
version: 1.10.1
|
57
|
+
meting_js:
|
58
|
+
name: meting
|
59
|
+
file: Meting.min.js
|
60
|
+
version: 2.0.1
|
61
|
+
pace_js:
|
62
|
+
name: pace-js
|
63
|
+
other_name: pace
|
64
|
+
file: pace.min.js
|
65
|
+
version: 1.2.4
|
66
|
+
lunr_js:
|
67
|
+
name: lunr
|
68
|
+
file: lunr.min.js
|
69
|
+
version: 2.3.9
|
70
|
+
swiper_css:
|
71
|
+
name: Swiper
|
72
|
+
file: swiper-bundle.min.css
|
73
|
+
version: 11.0.5
|
74
|
+
swiper_js:
|
75
|
+
name: Swiper
|
76
|
+
file: swiper-bundle.min.js
|
77
|
+
version: 11.0.5
|
78
|
+
busuanzi_js:
|
79
|
+
name: busuanzi
|
80
|
+
file: bsz.pure.mini.js
|
81
|
+
version: 2.3.0
|
82
|
+
snackbar_css:
|
83
|
+
name: node-snackbar
|
84
|
+
file: dist/snackbar.min.css
|
85
|
+
version: 0.1.16
|
86
|
+
snackbar:
|
87
|
+
name: node-snackbar
|
88
|
+
file: dist/snackbar.min.js
|
89
|
+
version: 0.1.16
|
90
|
+
scoicon_css:
|
91
|
+
name: solitude-source
|
92
|
+
file: icon/scoicon.min.css
|
93
|
+
version: 1.0.3
|
94
|
+
waterfall:
|
95
|
+
name: solitude-source
|
96
|
+
file: js/waterfall.min.js
|
97
|
+
version: 1.0.3
|
98
|
+
medium_zoom:
|
99
|
+
name: medium-zoom
|
100
|
+
file: dist/medium-zoom.min.js
|
101
|
+
version: 1.1.0
|
102
|
+
fancyapps_ui:
|
103
|
+
name: fancyapps-ui
|
104
|
+
file: dist/fancybox/fancybox.umd.js
|
105
|
+
version: 5.0.33
|
106
|
+
fancyapps_css:
|
107
|
+
name: fancyapps-ui
|
108
|
+
file: dist/fancybox/fancybox.min.css
|
109
|
+
version: 5.0.33
|