hexo-theme-solitude 1.2.6 → 1.3.1
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/CONTRIBUTING.md +41 -0
- package/README.md +8 -8
- package/README_EN.md +6 -6
- package/_config.yml +502 -297
- package/languages/en-US.yml +105 -8
- package/languages/zh-CN.yml +98 -1
- package/layout/archive.pug +4 -5
- package/layout/category.pug +4 -5
- package/layout/includes/body/mode.pug +40 -0
- package/layout/includes/console.pug +15 -16
- package/layout/includes/footer.pug +26 -28
- package/layout/includes/head/config.pug +27 -8
- package/layout/includes/head/fest.pug +22 -0
- package/layout/includes/head/opengraph.pug +11 -0
- package/layout/includes/head.pug +1 -3
- package/layout/includes/header.pug +1 -1
- package/layout/includes/inject/body.pug +36 -13
- package/layout/includes/inject/head.pug +30 -20
- package/layout/includes/layout.pug +12 -8
- package/layout/includes/loading.pug +1 -64
- package/layout/includes/mixins/articleSort.pug +4 -4
- package/layout/includes/mixins/pagination.pug +1 -1
- package/layout/includes/nav.pug +10 -10
- package/layout/includes/page/about.pug +1 -0
- package/layout/includes/page/categories.pug +3 -3
- package/layout/includes/page/default.pug +1 -1
- package/layout/includes/page/echarts.pug +3 -3
- package/layout/includes/page/equipment.pug +0 -1
- package/layout/includes/page/links.pug +5 -26
- package/layout/includes/page/moments.pug +0 -1
- package/layout/includes/page/music.pug +19 -0
- package/layout/includes/page/not_configured.pug +18 -0
- package/layout/includes/page/rss.pug +20 -22
- package/layout/includes/page/says.pug +1 -2
- package/layout/includes/page/tags.pug +3 -3
- package/layout/includes/page/tlink.pug +0 -1
- package/layout/includes/sidebar.pug +7 -7
- package/layout/includes/widgets/aside/aside.pug +13 -1
- package/layout/includes/widgets/aside/asideArchive.pug +5 -3
- package/layout/includes/widgets/aside/asideCustom.pug +6 -0
- package/layout/includes/widgets/aside/asideHistory.pug +3 -3
- package/layout/includes/widgets/aside/asideInfoCard.pug +4 -6
- package/layout/includes/widgets/aside/asideNewestPost.pug +1 -1
- package/layout/includes/widgets/aside/asideSwitch.pug +0 -11
- package/layout/includes/widgets/aside/asideTag.pug +2 -2
- package/layout/includes/widgets/aside/asideToc.pug +1 -1
- package/layout/includes/widgets/aside/asideWebInfo.pug +6 -6
- package/layout/includes/widgets/aside/asideWelcome.pug +1 -1
- package/layout/includes/widgets/home/banner.pug +2 -2
- package/layout/includes/widgets/home/bbTimeList.pug +3 -3
- package/layout/includes/widgets/home/categoryBar.pug +3 -3
- package/layout/includes/widgets/home/categoryGroup.pug +2 -2
- package/layout/includes/widgets/home/hometop.pug +7 -7
- package/layout/includes/widgets/home/postList.pug +12 -8
- package/layout/includes/widgets/home/topGroup.pug +17 -13
- package/layout/includes/widgets/nav/left.pug +6 -6
- package/layout/includes/widgets/nav/menu.pug +4 -4
- package/layout/includes/widgets/nav/right.pug +14 -14
- package/layout/includes/widgets/page/about/authorinfo.pug +1 -1
- package/layout/includes/widgets/page/about/award.pug +11 -9
- package/layout/includes/widgets/page/about/contentinfo.pug +7 -7
- package/layout/includes/widgets/page/about/hobbies.pug +1 -1
- package/layout/includes/widgets/page/about/motto.pug +2 -2
- package/layout/includes/widgets/page/about/other.pug +10 -9
- package/layout/includes/widgets/page/about/personalities.pug +2 -2
- package/layout/includes/widgets/page/about/skillsinfo.pug +10 -12
- package/layout/includes/widgets/page/about/tenyear.pug +48 -0
- package/layout/includes/widgets/page/banner.pug +2 -2
- package/layout/includes/widgets/page/links/banner.pug +12 -14
- package/layout/includes/widgets/page/links/linksItem.pug +0 -1
- package/layout/includes/widgets/page/moments/angle.pug +7 -12
- package/layout/includes/widgets/page/moments/index.pug +7 -2
- package/layout/includes/widgets/post/award.pug +12 -8
- package/layout/includes/widgets/post/copyright.pug +16 -14
- package/layout/includes/widgets/post/postMeta.pug +36 -25
- package/layout/includes/widgets/post/postNav.pug +15 -15
- package/layout/includes/widgets/randomlink.pug +10 -5
- package/layout/includes/widgets/rightside/index.pug +9 -8
- package/layout/includes/widgets/third-party/ai/index.pug +12 -0
- package/layout/includes/widgets/third-party/comments/comment.pug +6 -1
- package/layout/includes/widgets/third-party/comments/twikoo.pug +5 -4
- package/layout/includes/widgets/third-party/comments/waline.pug +4 -5
- package/layout/includes/widgets/third-party/music.pug +1 -1
- package/layout/includes/widgets/third-party/pjax.pug +6 -1
- package/layout/includes/widgets/third-party/search/algolia-search.pug +4 -3
- package/layout/includes/widgets/third-party/search/index.pug +2 -2
- package/layout/includes/widgets/third-party/search/local-search.pug +3 -3
- package/layout/index.pug +5 -6
- package/layout/page.pug +34 -29
- package/layout/post.pug +3 -23
- package/layout/tag.pug +3 -3
- package/package.json +2 -2
- package/scripts/filter/checkThemeConfig.js +0 -5
- package/scripts/helper/cdn.js +12 -0
- package/scripts/helper/page.js +13 -0
- package/scripts/helper/related_post.js +0 -1
- package/scripts/tags/button.js +21 -0
- package/scripts/tags/card.js +9 -0
- package/scripts/tags/checkbox.js +51 -0
- package/scripts/tags/fold.js +0 -5
- package/scripts/tags/image.js +75 -0
- package/scripts/tags/inline-image.js +12 -0
- package/scripts/tags/label.js +10 -0
- package/scripts/tags/link.js +2 -0
- package/scripts/tags/media.js +29 -0
- package/scripts/tags/span.js +17 -0
- package/scripts/tags/timeline.js +2 -15
- package/scripts/tags/u.js +7 -0
- package/source/css/_global/animation.css +57 -0
- package/source/css/_global/index.styl +5 -20
- package/source/css/_global/var.styl +16 -1
- package/source/css/_layout/{base.styl → basic.styl} +24 -116
- package/source/css/_layout/header.styl +204 -616
- package/source/css/_layout/index.styl +29 -271
- package/source/css/_mode/index.styl +102 -93
- package/source/css/_page/_home/category-bar.styl +74 -0
- package/source/css/_page/_home/home-top.styl +541 -0
- package/source/css/_page/_home/index.styl +15 -0
- package/source/css/_page/_home/pagination.styl +176 -0
- package/source/css/_page/_home/recent-post.styl +204 -0
- package/source/css/_page/about/index.styl +1 -0
- package/source/css/_page/about/tenyear.styl +56 -0
- package/source/css/_page/about.styl +555 -626
- package/source/css/_page/category.styl +95 -119
- package/source/css/_page/douban.styl +126 -0
- package/source/css/_page/equipment.styl +100 -99
- package/source/css/_page/error.styl +130 -146
- package/source/css/_page/home.styl +41 -50
- package/source/css/_page/index.styl +42 -10
- package/source/css/_page/links.styl +306 -0
- package/source/css/_page/moment.styl +51 -51
- package/source/css/_page/music.styl +506 -0
- package/source/css/_page/rss.styl +62 -67
- package/source/css/_page/says.styl +375 -344
- package/source/css/_page/tag.styl +15 -13
- package/source/css/_widgets/{aside → _aside}/flip.styl +7 -5
- package/source/css/_widgets/{aside → _aside}/history.styl +9 -2
- package/source/css/_widgets/_aside/index.styl +96 -0
- package/source/css/_widgets/{aside → _aside}/info.styl +86 -89
- package/source/css/_widgets/{aside → _aside}/newPost.styl +7 -1
- package/source/css/_widgets/{aside → _aside}/toc.styl +28 -5
- package/source/css/_widgets/{comment → _comment}/index.styl +4 -12
- package/source/css/_widgets/{comment → _comment}/twikoo.styl +5 -2
- package/source/css/_widgets/{comment → _comment}/waline.styl +21 -5
- package/source/css/{_extra → _widgets/_extra}/console.styl +33 -10
- package/source/css/_widgets/_extra/fullpage.styl +46 -0
- package/source/css/_widgets/_extra/music.styl +218 -0
- package/source/css/_widgets/_extra/pace.styl +39 -0
- package/source/css/_widgets/_extra/rightmenu.styl +78 -0
- package/source/css/_widgets/_mixins/article-sort.styl +93 -0
- package/source/css/_widgets/_mixins/footer.styl +273 -0
- package/source/css/_widgets/_mixins/other.styl +34 -0
- package/source/css/_widgets/_mixins/sidebar.styl +230 -0
- package/source/css/_widgets/_post/_highlight/diff.styl +75 -0
- package/source/css/_widgets/_post/_highlight/index.styl +144 -0
- package/source/css/_widgets/_post/_highlight/theme/default.styl +12 -0
- package/source/css/_widgets/_post/_highlight/theme/mac.styl +25 -0
- package/source/css/_widgets/_post/_highlight/theme.styl +68 -0
- package/source/css/_widgets/_post/commentBarrage.styl +144 -0
- package/source/css/_widgets/_post/content.styl +152 -0
- package/source/css/_widgets/_post/copyright.styl +98 -0
- package/source/css/_widgets/_post/index.styl +20 -0
- package/source/css/_widgets/_post/meta.styl +420 -0
- package/source/css/_widgets/_post/pagination.styl +177 -0
- package/source/css/_widgets/_post/postAI.styl +131 -0
- package/source/css/{_post → _widgets/_post}/relatedPost.styl +4 -1
- package/source/css/_widgets/_post/tools.styl +249 -0
- package/source/css/{_search → _widgets/_search}/algolia-search.styl +4 -0
- package/source/css/{_search → _widgets/_search}/local-search.styl +15 -5
- package/source/css/_widgets/_tags/button.styl +60 -0
- package/source/css/_widgets/_tags/bvideo.styl +8 -0
- package/source/css/_widgets/_tags/card.styl +52 -0
- package/source/css/_widgets/_tags/checkbox.styl +85 -0
- package/source/css/_widgets/_tags/fold.styl +79 -0
- package/source/css/_widgets/_tags/image.styl +10 -0
- package/source/css/_widgets/_tags/index.styl +61 -0
- package/source/css/_widgets/_tags/inline-image.styl +6 -0
- package/source/css/_widgets/_tags/label.styl +3 -0
- package/source/css/_widgets/_tags/link.styl +80 -0
- package/source/css/_widgets/_tags/note.styl +101 -0
- package/source/css/_widgets/_tags/span.styl +61 -0
- package/source/css/_widgets/_tags/tabs.styl +105 -0
- package/source/css/_widgets/_tags/timeline.styl +80 -0
- package/source/css/_widgets/index.styl +50 -1
- package/source/css/index.styl +0 -25
- package/source/js/{commentBarrage.js → extend/comment/twikoo/commentBarrage.js} +0 -4
- package/source/js/extend/comment/{twikoo.js → twikoo/twikoo.js} +12 -40
- package/source/js/extend/comment/waline/commentBarrage.js +155 -0
- package/source/js/extend/comment/{waline.js → waline/waline.js} +10 -11
- package/source/js/extend/search/algolia-search.js +1 -5
- package/source/js/extend/search/local-search.js +33 -13
- package/source/js/main.js +135 -171
- package/source/js/music.js +129 -0
- package/source/js/utils.js +4 -7
- package/source/lib/cover-color.min.js +7 -0
- package/source/lib/rightside.min.js +1 -0
- package/source/lib/sco-ai.min.js +8 -0
- package/source/lib/snackbar.min.css +1 -1
- package/source/lib/txmap.min.js +1 -0
- package/source/lib/universe.min.js +1 -0
- package/source/lib/view-image.min.js +1 -1
- package/layout/includes/widgets/aside/asidePower.pug +0 -19
- package/layout/includes/widgets/home/rencentPost.pug +0 -26
- package/source/css/_extra/rightmenu.styl +0 -83
- package/source/css/_layout/articleSort.styl +0 -199
- package/source/css/_layout/footer.styl +0 -359
- package/source/css/_layout/sidebar.styl +0 -226
- package/source/css/_page/homeTop.styl +0 -1035
- package/source/css/_page/link.styl +0 -433
- package/source/css/_post/commentBarrage.styl +0 -149
- package/source/css/_post/externalTags.styl +0 -694
- package/source/css/_post/highlight.styl +0 -96
- package/source/css/_post/index.styl +0 -935
- package/source/css/_post/pagination.styl +0 -467
- package/source/css/_post/postContent.styl +0 -957
- package/source/css/_post/reward.styl +0 -217
- package/source/css/_widgets/aside/index.styl +0 -156
- package/source/css/_widgets/aside/power.styl +0 -90
- package/source/img/logo-horizontal_version.png +0 -0
- package/source/img/pwa/16.png +0 -0
- package/source/img/pwa/180.png +0 -0
- package/source/img/pwa/192.png +0 -0
- package/source/img/pwa/32.png +0 -0
- package/source/img/pwa/512.png +0 -0
- package/source/img/pwa/logo.png +0 -0
- package/source/img/pwa/siteicon/splash-1125x2436.png +0 -0
- package/source/img/pwa/siteicon/splash-1136x640.png +0 -0
- package/source/img/pwa/siteicon/splash-1170x2532.png +0 -0
- package/source/img/pwa/siteicon/splash-1179x2556.png +0 -0
- package/source/img/pwa/siteicon/splash-1242x2208.png +0 -0
- package/source/img/pwa/siteicon/splash-1242x2688.png +0 -0
- package/source/img/pwa/siteicon/splash-1248x2778.png +0 -0
- package/source/img/pwa/siteicon/splash-1290x2796.png +0 -0
- package/source/img/pwa/siteicon/splash-1334x750.png +0 -0
- package/source/img/pwa/siteicon/splash-1536x2048.png +0 -0
- package/source/img/pwa/siteicon/splash-1620x2160.png +0 -0
- package/source/img/pwa/siteicon/splash-1668x2224.png +0 -0
- package/source/img/pwa/siteicon/splash-1668x2388.png +0 -0
- package/source/img/pwa/siteicon/splash-1792x828.png +0 -0
- package/source/img/pwa/siteicon/splash-2048x1536.png +0 -0
- package/source/img/pwa/siteicon/splash-2048x2732.png +0 -0
- package/source/img/pwa/siteicon/splash-2160x1620.png +0 -0
- package/source/img/pwa/siteicon/splash-2208x1242.png +0 -0
- package/source/img/pwa/siteicon/splash-2224x1668.png +0 -0
- package/source/img/pwa/siteicon/splash-2388x1668.png +0 -0
- package/source/img/pwa/siteicon/splash-2436x1125.png +0 -0
- package/source/img/pwa/siteicon/splash-2532x1170.png +0 -0
- package/source/img/pwa/siteicon/splash-2556x1179.png +0 -0
- package/source/img/pwa/siteicon/splash-2688x1242.png +0 -0
- package/source/img/pwa/siteicon/splash-2732x2048.png +0 -0
- package/source/img/pwa/siteicon/splash-2778x1248.png +0 -0
- package/source/img/pwa/siteicon/splash-2796x1290.png +0 -0
- package/source/img/pwa/siteicon/splash-640x1136.png +0 -0
- package/source/img/pwa/siteicon/splash-750x1334.png +0 -0
- package/source/img/pwa/siteicon/splash-828x1792.png +0 -0
- package/source/img/solitude-show.jpg +0 -0
- package/source/js/extend/covercolor/local.js +0 -160
- package/source/js/rightside.js +0 -402
- package/source/js/txmap.js +0 -236
- package/source/lib/chuckle-post-ai.js +0 -1
- /package/source/css/_widgets/{aside → _aside}/allinfo.styl +0 -0
- /package/source/css/_widgets/{aside → _aside}/welcome.styl +0 -0
- /package/source/img/{theme/avatar.png → avatar.png} +0 -0
package/layout/page.pug
CHANGED
@@ -1,32 +1,37 @@
|
|
1
1
|
extends includes/layout.pug
|
2
2
|
|
3
3
|
block content
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
4
|
+
main.layout#content-inner(class=page.aside ? '' : 'hide-aside')
|
5
|
+
#page
|
6
|
+
case page.type
|
7
|
+
when 'categories'
|
8
|
+
include includes/page/categories
|
9
|
+
when 'tags'
|
10
|
+
include includes/page/tags
|
11
|
+
when 'links'
|
12
|
+
include includes/page/links
|
13
|
+
when 'tlink'
|
14
|
+
include includes/page/tlink
|
15
|
+
when 'about'
|
16
|
+
include includes/page/about
|
17
|
+
when 'says'
|
18
|
+
include includes/page/says
|
19
|
+
when 'equipment'
|
20
|
+
include includes/page/equipment
|
21
|
+
when 'moments'
|
22
|
+
include includes/page/moments
|
23
|
+
when 'echarts'
|
24
|
+
include includes/page/echarts
|
25
|
+
when 'rss'
|
26
|
+
include includes/page/rss
|
27
|
+
when 'douban'
|
28
|
+
include includes/widgets/page/banner
|
29
|
+
include includes/page/default
|
30
|
+
when 'music'
|
31
|
+
include includes/page/music
|
32
|
+
default
|
33
|
+
include includes/page/default
|
34
|
+
if page.comment
|
35
|
+
include includes/widgets/third-party/comments/comment
|
36
|
+
if page.aside
|
37
|
+
include includes/widgets/aside/aside
|
package/layout/post.pug
CHANGED
@@ -3,6 +3,8 @@ extends includes/layout.pug
|
|
3
3
|
block content
|
4
4
|
main.layout#content-inner
|
5
5
|
#post
|
6
|
+
if theme.thirdparty.ai.enable
|
7
|
+
include includes/widgets/third-party/ai/index
|
6
8
|
article.post-content#article-container!= page.content
|
7
9
|
include includes/widgets/post/copyright
|
8
10
|
.post-tools-right
|
@@ -18,26 +20,4 @@ block content
|
|
18
20
|
!= related_posts(page, site.posts)
|
19
21
|
if page.comment
|
20
22
|
include includes/widgets/third-party/comments/comment
|
21
|
-
include includes/widgets/aside/aside
|
22
|
-
if theme.thirdparty.ai.enable
|
23
|
-
- let ai_black_list = theme.thirdparty.ai.BlackWhite_List.mode === 'black' ? theme.thirdparty.ai.BlackWhite_List.List.map(item => `'${item}'`).join(', ') : '';
|
24
|
-
- let ai_white_list = theme.thirdparty.ai.BlackWhite_List.mode === 'white' ? theme.thirdparty.ai.BlackWhite_List.List.map(item => `'${item}'`).join(', ') : '';
|
25
|
-
script(data-pjax, defer).
|
26
|
-
new ChucklePostAI({
|
27
|
-
el: '#post #article-container',
|
28
|
-
key: '#{theme.thirdparty.ai.key}',
|
29
|
-
title_el: '.post-title',
|
30
|
-
rec_method: '#{theme.thirdparty.ai.rec_method || 'web'}',
|
31
|
-
interface: {
|
32
|
-
name: "#{theme.thirdparty.ai.ai_name || 'Solitude AI'}",
|
33
|
-
introduce: "#{theme.thirdparty.ai.ai_introduce || '我是文章辅助AI生成工具: Solitude AI。你可以点击下方的按钮,让我生成本文简介、推荐相关文章等。'}",
|
34
|
-
version: "#{theme.thirdparty.ai.ai_tips || 'GPT 4'}",
|
35
|
-
},
|
36
|
-
hide_shuttle: !{!!theme.thirdparty.ai.hide_shuttle},
|
37
|
-
typewriter: !{!!theme.thirdparty.ai.typewriter},
|
38
|
-
speed: !{!!theme.thirdparty.ai.speed},
|
39
|
-
eliminate: [!{ai_black_list}],
|
40
|
-
whitelist: [!{ai_white_list}],
|
41
|
-
total_length: !{page.ai_total_length ? page.ai_total_length : 0},
|
42
|
-
ratio_string: !{page.ai_ratio_string ? page.ai_ratio_string : 0},
|
43
|
-
})
|
23
|
+
include includes/widgets/aside/aside
|
package/layout/tag.pug
CHANGED
@@ -2,14 +2,14 @@ extends includes/layout.pug
|
|
2
2
|
|
3
3
|
block content
|
4
4
|
main.layout#content-inner
|
5
|
-
|
6
|
-
|
5
|
+
#tag
|
6
|
+
#tag-page-tags
|
7
7
|
each tag in site.tags.find({ parent: { $exists: false } }).data
|
8
8
|
a(id=tag.name class=(tag.name === page.tag ? 'select' : '') href=url_for(tag.path))
|
9
9
|
span.tags-punctuation
|
10
10
|
| #{tag.name}
|
11
11
|
span.tagsPageCount #{tag.length}
|
12
|
-
|
12
|
+
.recent-posts#recent-posts
|
13
13
|
each post in page.posts.find({ parent: { $exists: false } }).data
|
14
14
|
include includes/widgets/home/postList
|
15
15
|
include includes/mixins/pagination
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hexo-theme-solitude",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.3.1",
|
4
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"
|
@@ -20,4 +20,4 @@
|
|
20
20
|
"url": "https://github.com/DuoSco/Hexo-theme-solitude/issues"
|
21
21
|
},
|
22
22
|
"homepage": "https://github.com/DuoSco/hexo-theme-solitude#readme"
|
23
|
-
}
|
23
|
+
}
|
@@ -3,15 +3,10 @@
|
|
3
3
|
hexo.extend.filter.register('before_post_render', () => {
|
4
4
|
const logger = hexo.log;
|
5
5
|
const theme = hexo.theme.config;
|
6
|
-
const config = hexo.config;
|
7
6
|
if (theme.hometop.banner.enable && !theme.hometop.banner.icon) {
|
8
7
|
logger.error('\n 启用banner的情况下,必须提供 icon 图片!\n 请在主题配置文件中设置 hometop.banner.icon 选项。');
|
9
8
|
logger.error('\n If banner is enabled, icon image must be supplied! \n Please set the hometop.banner.icon option in the theme configuration file.');
|
10
9
|
process.exit(-1);
|
11
10
|
}
|
12
|
-
if (config.language !== 'zh-CN' && config.language !== 'en-US') {
|
13
|
-
logger.error('\n 请在站点配置文件中设置 language 选项为 zh-CN 或 en-US。');
|
14
|
-
process.exit(-1);
|
15
|
-
}
|
16
11
|
}
|
17
12
|
);
|
@@ -0,0 +1,12 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
hexo.extend.helper.register('cdn_url_for', function(path) {
|
4
|
+
const {config, theme} = this
|
5
|
+
const cdnPrefix = theme.cdn.prefix;
|
6
|
+
const urlFor = hexo.extend.helper.get('url_for').bind(this);
|
7
|
+
if (cdnPrefix) {
|
8
|
+
return cdnPrefix + urlFor(path);
|
9
|
+
} else {
|
10
|
+
return urlFor(path);
|
11
|
+
}
|
12
|
+
});
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
const { stripHTML, escapeHTML } = require('hexo-util')
|
3
|
+
hexo.extend.helper.register('page_description', function () {
|
4
|
+
const { config, page } = this
|
5
|
+
let description = page.description || page.content || page.title || config.description
|
6
|
+
|
7
|
+
if (description) {
|
8
|
+
description = escapeHTML(stripHTML(description).substring(0, 150)
|
9
|
+
.trim()
|
10
|
+
).replace(/\n/g, ' ').replace(/\s+/g, ' ');
|
11
|
+
return description
|
12
|
+
}
|
13
|
+
})
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
const urlFor = require("hexo-util").url_for.bind(hexo);
|
4
|
+
|
5
|
+
function btn(args) {
|
6
|
+
args = args.join(" ").split(",");
|
7
|
+
let url = args[0] || "";
|
8
|
+
let text = args[1] || "";
|
9
|
+
let icon = args[2] || "";
|
10
|
+
let option = args[3] || "";
|
11
|
+
|
12
|
+
url = url.trim();
|
13
|
+
text = text.trim();
|
14
|
+
icon = icon.trim();
|
15
|
+
option = option.trim();
|
16
|
+
|
17
|
+
return `<button class="btn-sco ${option}" onclick="location.href = '${urlFor(url)}'"
|
18
|
+
title="${text}">${icon.length ? `<i class="${icon}"></i>` : ""}${text.length ? `<span>${text}</span>` : ""}</button>`;
|
19
|
+
}
|
20
|
+
|
21
|
+
hexo.extend.tag.register("btn", btn, { ends: false });
|
@@ -0,0 +1,9 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
hexo.extend.tag.register('card', function (args, content) {
|
4
|
+
args = args.join(' ').split(',');
|
5
|
+
let icon = args[0] || 'no-icon';
|
6
|
+
let color = args[1] || 'info';
|
7
|
+
let title = args[2] || '';
|
8
|
+
return `<div class="card card-${color}"><div class="card-title"><i class="scoicon ${icon}"></i>${title}</div>${hexo.render.renderSync({text: content, engine: 'markdown'})}</div>`
|
9
|
+
}, {ends: true});
|
@@ -0,0 +1,51 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
function postCheckbox(args) {
|
4
|
+
args = args.join(' ').split(',')
|
5
|
+
var cls = ''
|
6
|
+
var text = ''
|
7
|
+
var checked = false
|
8
|
+
if (args.length > 1) {
|
9
|
+
cls = (args[0] || '').trim()
|
10
|
+
if (cls.length > 0) {
|
11
|
+
cls = ' ' + cls
|
12
|
+
}
|
13
|
+
if (cls.indexOf('checked') > -1) {
|
14
|
+
checked = true
|
15
|
+
}
|
16
|
+
text = (args[1] || '').trim()
|
17
|
+
} else if (args.length > 0) {
|
18
|
+
text = (args[0] || '').trim()
|
19
|
+
}
|
20
|
+
if (text.length > 0) {
|
21
|
+
return `<div class='checkbox${cls}'><input type="checkbox" ${ checked ? 'checked="checked"' : '' }/>
|
22
|
+
${hexo.render.renderSync({text: text, engine: 'markdown'}).split('\n').join('')}
|
23
|
+
</div>`
|
24
|
+
}
|
25
|
+
}
|
26
|
+
function postRadio(args) {
|
27
|
+
args = args.join(' ').split(',')
|
28
|
+
var cls = ''
|
29
|
+
var text = ''
|
30
|
+
var checked = false
|
31
|
+
if (args.length > 1) {
|
32
|
+
cls = (args[0] || '').trim()
|
33
|
+
if (cls.length > 0) {
|
34
|
+
cls = ' ' + cls
|
35
|
+
}
|
36
|
+
if (cls.indexOf('checked') > -1) {
|
37
|
+
checked = true
|
38
|
+
}
|
39
|
+
text = (args[1] || '').trim()
|
40
|
+
} else if (args.length > 0) {
|
41
|
+
text = (args[0] || '').trim()
|
42
|
+
}
|
43
|
+
if (text.length > 0) {
|
44
|
+
return `<div class='checkbox${cls}'><input type="radio" ${ checked ? 'checked="checked"' : '' }/>
|
45
|
+
${hexo.render.renderSync({text: text, engine: 'markdown'}).split('\n').join('')}
|
46
|
+
</div>`
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
hexo.extend.tag.register('checkbox', postCheckbox);
|
51
|
+
hexo.extend.tag.register('radio', postRadio);
|
package/scripts/tags/fold.js
CHANGED
@@ -0,0 +1,75 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
hexo.extend.tag.register('image', function(args) {
|
4
|
+
args = args.join(' ').split(', ');
|
5
|
+
let url = args[0].trim();
|
6
|
+
let alt = '';
|
7
|
+
let bg = '';
|
8
|
+
let style = '';
|
9
|
+
if (args.length > 1) {
|
10
|
+
for (let i = 1; i < args.length; i++) {
|
11
|
+
let tmp = args[i].trim();
|
12
|
+
if (tmp.includes('alt=')) {
|
13
|
+
alt = tmp.substring(4, tmp.length);
|
14
|
+
} else if (tmp.includes('width=')) {
|
15
|
+
style += 'width:' + tmp.substring(6, tmp.length) + ';';
|
16
|
+
} else if (tmp.includes('height=')) {
|
17
|
+
style += 'height:' + tmp.substring(7, tmp.length) + ';';
|
18
|
+
} else if (tmp.includes('bg=')) {
|
19
|
+
bg = tmp.substring(3, tmp.length);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
function img(url, alt, style) {
|
24
|
+
let img = '';
|
25
|
+
img += '<img class="img" src="' + url + '"';
|
26
|
+
if (alt.length > 0) {
|
27
|
+
img += ' alt="' + alt + '"';
|
28
|
+
}
|
29
|
+
if (style.length > 0) {
|
30
|
+
img += ' style="' + style + '"';
|
31
|
+
}
|
32
|
+
img += '/>';
|
33
|
+
return img;
|
34
|
+
}
|
35
|
+
|
36
|
+
let ret = '';
|
37
|
+
ret += '<div class="img-wrap">';
|
38
|
+
ret += '<div class="img-bg"';
|
39
|
+
if (bg.length > 0) {
|
40
|
+
ret += ' style="background:' + bg + '"';
|
41
|
+
}
|
42
|
+
ret += '>';
|
43
|
+
ret += img(url, alt, style);
|
44
|
+
ret += '</div>';
|
45
|
+
|
46
|
+
if (alt.length > 0) {
|
47
|
+
ret += '<span class="image-caption">' + alt + '</span>';
|
48
|
+
}
|
49
|
+
|
50
|
+
ret += '</div>';
|
51
|
+
return ret;
|
52
|
+
});
|
53
|
+
|
54
|
+
hexo.extend.tag.register('inlineimage', function(args) {
|
55
|
+
args = args.join(' ').split(', ');
|
56
|
+
let url = args[0].trim();
|
57
|
+
let ret = '';
|
58
|
+
ret += '<img no-lazy class="inline" src="' + url + '"';
|
59
|
+
let style = '';
|
60
|
+
if (args.length > 1) {
|
61
|
+
for (let i = 1; i < args.length; i++) {
|
62
|
+
let tmp = args[i].trim();
|
63
|
+
if (tmp.includes('height=')) {
|
64
|
+
style += 'height:' + tmp.substring(7, tmp.length) + ';';
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}
|
68
|
+
if (style.length > 0) {
|
69
|
+
ret += ' style="' + style + '"';
|
70
|
+
} else {
|
71
|
+
ret += ' style="height:1.5em"';
|
72
|
+
}
|
73
|
+
ret += '/>';
|
74
|
+
return ret;
|
75
|
+
});
|
@@ -0,0 +1,12 @@
|
|
1
|
+
'use strict'
|
2
|
+
|
3
|
+
const urlFor = require('hexo-util').url_for.bind(hexo)
|
4
|
+
|
5
|
+
function inlineImg (args) {
|
6
|
+
const img = args[0]
|
7
|
+
const height = args[1] ? `style="height:${args[1]}"` : ''
|
8
|
+
|
9
|
+
return `<img class="inline-img" src="${urlFor(img)}" ${height}/>`
|
10
|
+
}
|
11
|
+
|
12
|
+
hexo.extend.tag.register('inlineimage', inlineImg, { ends: false })
|
package/scripts/tags/link.js
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
function postAudio(args) {
|
4
|
+
let src = args[0].trim()
|
5
|
+
return `<div class="audio"><audio controls preload><source src='${src}' type='audio/mp3'>Your browser does not support the audio tag.</audio></div>`;
|
6
|
+
}
|
7
|
+
|
8
|
+
function postVideo(args) {
|
9
|
+
let src = args[0].trim()
|
10
|
+
return `<div class="video"><video controls preload><source src='${src}' type='video/mp4'>Your browser does not support the video tag.</video></div>`;
|
11
|
+
}
|
12
|
+
|
13
|
+
function postVideos(args, content) {
|
14
|
+
args = args.join(' ').split(',')
|
15
|
+
var cls = args[0]
|
16
|
+
if (cls.length > 0) {
|
17
|
+
cls = ' ' + cls
|
18
|
+
}
|
19
|
+
var col = Number(args[1]) || 0;
|
20
|
+
if (col > 0) {
|
21
|
+
return `<div class="videos${cls}" col='${col}'>${content}</div>`
|
22
|
+
} else {
|
23
|
+
return `<div class="videos${cls}">${content}</div>`
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
hexo.extend.tag.register('audio', postAudio);
|
28
|
+
hexo.extend.tag.register('video', postVideo);
|
29
|
+
hexo.extend.tag.register('videos', postVideos, {ends: true});
|
@@ -0,0 +1,17 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
function postP(args) {
|
4
|
+
args = args.join(' ').split(',')
|
5
|
+
let p0 = args[0].trim()
|
6
|
+
let p1 = args[1].trim()
|
7
|
+
return `<p class='p ${p0}'>${p1}</p>`;
|
8
|
+
}
|
9
|
+
function postSpan(args) {
|
10
|
+
args = args.join(' ').split(',')
|
11
|
+
let p0 = args[0].trim()
|
12
|
+
let p1 = args[1].trim()
|
13
|
+
return `<span class='p ${p0}'>${p1}</span>`;
|
14
|
+
}
|
15
|
+
|
16
|
+
hexo.extend.tag.register('p', postP);
|
17
|
+
hexo.extend.tag.register('span', postSpan);
|
package/scripts/tags/timeline.js
CHANGED
@@ -1,8 +1,4 @@
|
|
1
|
-
|
2
|
-
* timeline.js | https://volantis.js.org/v3/tag-plugins/#Timeline
|
3
|
-
*/
|
4
|
-
|
5
|
-
"use strict";
|
1
|
+
"use strict"
|
6
2
|
|
7
3
|
function postTimeline(args, content) {
|
8
4
|
if (args.length > 0) {
|
@@ -15,21 +11,12 @@ function postTimeline(args, content) {
|
|
15
11
|
function postTimenode(args, content) {
|
16
12
|
args = args.join(" ").split(",");
|
17
13
|
var time = args[0];
|
18
|
-
return `<div class="timenode"><div class="meta"><p>${hexo.render
|
19
|
-
text: time,
|
20
|
-
engine: "markdown",
|
21
|
-
})}</p></div><div class="body">${hexo.render
|
14
|
+
return `<div class="timenode"><div class="meta"><p>${time}</p></div><div class="body">${hexo.render
|
22
15
|
.renderSync({ text: content, engine: "markdown" })
|
23
16
|
.split("\n")
|
24
17
|
.join("")}</div></div>`;
|
25
18
|
}
|
26
19
|
|
27
|
-
// {% timeline %}
|
28
|
-
// ... timenode ...
|
29
|
-
// {% endtimeline %}
|
30
20
|
hexo.extend.tag.register("timeline", postTimeline, { ends: true });
|
31
21
|
|
32
|
-
// {% timenode time %}
|
33
|
-
// what happened
|
34
|
-
// {% endtimenode %}
|
35
22
|
hexo.extend.tag.register("timenode", postTimenode, { ends: true });
|
@@ -753,4 +753,61 @@
|
|
753
753
|
100% {
|
754
754
|
transform: translate(0, -4px)
|
755
755
|
}
|
756
|
+
}
|
757
|
+
|
758
|
+
@media screen and (min-width: 768px) {
|
759
|
+
@keyframes showCover {
|
760
|
+
from {
|
761
|
+
opacity: 0;
|
762
|
+
transform: rotate(10deg) translateY(-8%) scale(1.8);
|
763
|
+
}
|
764
|
+
to {
|
765
|
+
opacity: 0.5;
|
766
|
+
transform: rotate(10deg) translateY(-10%) scale(2);
|
767
|
+
}
|
768
|
+
}
|
769
|
+
}
|
770
|
+
|
771
|
+
@keyframes blinking-cursor {
|
772
|
+
0% {
|
773
|
+
transform: scale(.6)
|
774
|
+
}
|
775
|
+
|
776
|
+
25% {
|
777
|
+
transform: scale(1)
|
778
|
+
}
|
779
|
+
|
780
|
+
50% {
|
781
|
+
transform: scale(.6)
|
782
|
+
}
|
783
|
+
|
784
|
+
75% {
|
785
|
+
transform: scale(1)
|
786
|
+
}
|
787
|
+
|
788
|
+
100% {
|
789
|
+
transform: scale(.6)
|
790
|
+
}
|
791
|
+
}
|
792
|
+
|
793
|
+
@keyframes AILoading {
|
794
|
+
0% {
|
795
|
+
opacity: 1
|
796
|
+
}
|
797
|
+
|
798
|
+
25% {
|
799
|
+
opacity: .3
|
800
|
+
}
|
801
|
+
|
802
|
+
50% {
|
803
|
+
opacity: 1
|
804
|
+
}
|
805
|
+
|
806
|
+
75% {
|
807
|
+
opacity: .3
|
808
|
+
}
|
809
|
+
|
810
|
+
100% {
|
811
|
+
opacity: 1
|
812
|
+
}
|
756
813
|
}
|
@@ -6,7 +6,10 @@
|
|
6
6
|
--sco-none #00000000
|
7
7
|
--sco-gray #999999
|
8
8
|
--sco-gray-op #9999992b
|
9
|
+
--sco-cyan #00bcd4
|
10
|
+
--sco-cyan-op #00bcd42b
|
9
11
|
--sco-vip #e5a80d
|
12
|
+
--sco-life #57bd6a
|
10
13
|
--sco-main var(--sco-theme)
|
11
14
|
--sco-main-op var(--sco-theme-op)
|
12
15
|
--sco-main-op-deep var(--sco-theme-op-deep)
|
@@ -51,26 +54,8 @@
|
|
51
54
|
--card-box-shadow 0 3px 8px 6px rgba(7, 17, 27, 0.06)
|
52
55
|
--card-hover-box-shadow 0 3px 8px 6px rgba(7, 17, 27, 0.15)
|
53
56
|
--offset 0px
|
54
|
-
|
55
|
-
// highlight
|
56
|
-
--hl-color #eff
|
57
|
-
--hl-bg #212121
|
58
|
-
--hltools-bg #1c1c1c
|
59
|
-
--hltools-color rgba(238, 255, 255, 0.8)
|
60
|
-
--hlnumber-bg #212121
|
61
|
-
--hlnumber-color rgba(238, 255, 255, 0.5)
|
62
57
|
--hlscrollbar-bg #121212
|
63
|
-
--hlexpand-bg linear-gradient(180deg, rgba(33, 33, 33, 0.6), rgba(33, 33, 33, 0.9))
|
64
|
-
|
65
|
-
// ai摘要
|
66
|
-
--ai-post-bg rgba(255, 255, 255, 0.32)
|
67
|
-
--ai-border 1px solid #e3e8f7bd
|
68
|
-
--ai-tag-bg rgba(48, 52, 63, 0.86)
|
69
|
-
--ai-cursor #333
|
70
|
-
|
71
|
-
// 个性定位
|
72
|
-
--icat-card-welcome #49b1f5
|
73
58
|
|
74
59
|
+maxWidth768()
|
75
|
-
--style-border 0px solid var(--sco-none)
|
76
|
-
--style-border-hover 0px solid var(--sco-main)
|
60
|
+
--style-border 0px solid var(--sco-none)
|
61
|
+
--style-border-hover 0px solid var(--sco-main)
|
@@ -7,4 +7,19 @@ $dark_theme_none = hexo-config('theme_color.dark_none')
|
|
7
7
|
$light_theme = convert(hexo-config('theme_color.light'))
|
8
8
|
$light_theme_op = convert(hexo-config('theme_color.light_op'))
|
9
9
|
$light_theme_op_deep = convert(hexo-config('theme_color.light_op_deep'))
|
10
|
-
$light_theme_none = hexo-config('theme_color.light_none')
|
10
|
+
$light_theme_none = hexo-config('theme_color.light_none')
|
11
|
+
|
12
|
+
$todayCardColor = convert(hexo-config('hometop.recommendList.color'))
|
13
|
+
|
14
|
+
// highlight code
|
15
|
+
if hexo-config('hightlight.theme') == 'default'
|
16
|
+
$hl_bg_light = #fff
|
17
|
+
$hltools_bg_light = #f7f7f9
|
18
|
+
$hl_bg_dark = #1b1c20
|
19
|
+
$hltools_bg_dark = #21232a
|
20
|
+
|
21
|
+
else if hexo-config('hightlight.theme') == 'mac'
|
22
|
+
$hl_bg_light = #FFFFFF
|
23
|
+
$hltools_bg_light = #E7E7E7
|
24
|
+
$hl_bg_dark = #1C1E1E
|
25
|
+
$hltools_bg_dark = #2A282A
|