hexo-theme-solitude 1.4.2 → 1.4.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 (41) hide show
  1. package/CONTRIBUTING.md +1 -1
  2. package/README.md +1 -1
  3. package/README_EN.md +1 -1
  4. package/_config.yml +13 -3
  5. package/languages/en-US.yml +31 -2
  6. package/languages/zh-CN.yml +32 -2
  7. package/languages/zh-TW.yml +147 -0
  8. package/layout/includes/footer.pug +1 -1
  9. package/layout/includes/head/config.pug +15 -2
  10. package/layout/includes/inject/body.pug +12 -4
  11. package/layout/includes/layout.pug +4 -0
  12. package/layout/includes/page/album.pug +4 -21
  13. package/layout/includes/page/music.pug +1 -4
  14. package/layout/includes/page/says.pug +1 -3
  15. package/layout/includes/widgets/home/bb/json.pug +2 -1
  16. package/layout/includes/widgets/home/bb/local.pug +2 -3
  17. package/layout/includes/widgets/home/bb/memos.pug +2 -1
  18. package/layout/includes/widgets/page/about/authorinfo.pug +1 -1
  19. package/layout/includes/widgets/page/about/hobbies.pug +2 -2
  20. package/layout/includes/widgets/page/about/motto.pug +17 -15
  21. package/layout/includes/widgets/page/about/skillsinfo.pug +38 -36
  22. package/layout/includes/widgets/page/about/tenyear.pug +1 -1
  23. package/layout/includes/widgets/page/says/json.pug +3 -3
  24. package/layout/includes/widgets/page/says/local.pug +1 -1
  25. package/layout/includes/widgets/rightside/index.pug +33 -22
  26. package/package.json +1 -1
  27. package/plugins.yml +6 -2
  28. package/scripts/event/cdn.js +5 -0
  29. package/scripts/event/init.js +18 -19
  30. package/scripts/event/page.js +0 -5
  31. package/scripts/filter/checkThemeConfig.js +23 -7
  32. package/scripts/helper/related_post.js +0 -6
  33. package/scripts/helper/stylus.js +8 -3
  34. package/source/css/_layout/index.styl +54 -34
  35. package/source/css/_page/about/index.styl +26 -16
  36. package/source/css/_page/gallery/index.styl +11 -8
  37. package/source/css/_widgets/_comment/twikoo.styl +1 -1
  38. package/source/js/rightside.js +159 -342
  39. package/source/js/tw_cn.js +76 -0
  40. package/layout/includes/page/not_configured.pug +0 -18
  41. package/scripts/helper/cdn.js +0 -12
@@ -37,7 +37,7 @@ if tenyear
37
37
  progressElement.style.setProperty("--progress-percentage", progressPercentage);
38
38
  if(progress > 5){
39
39
  percentageLabelElement.textContent = `${progress.toFixed(0)}%`;
40
- percentageLabelElement.style.left = `calc(${progress}% - 28px)`;
40
+ percentageLabelElement.style.left = `calc(${progress}% - 35px)`;
41
41
  }
42
42
  }
43
43
 
@@ -26,9 +26,9 @@ case theme.says.style
26
26
  <div class="bber-info">
27
27
  <div class="bber-info-time">
28
28
  <i class="scoicon sco-calendar-todo-fill"></i>
29
- <time class="datetime" datetime="${item.create_time}"></time>
29
+ <time class="datetime" datetime="${item.date}"></time>
30
30
  </div>
31
- ${item.link ? `<a class="bber-content-link" href="${item.link}" title="跳转到短文指引的链接"><i class="scoicon sco-link-m-line"></i>链接</a>` : ''}
31
+ ${item.link ? `<a class="bber-content-link" href="${item.link}" title="跳转到短文指引的链接" target="_blank"><i class="scoicon sco-link-m-line"></i>链接</a>` : ''}
32
32
  </div>
33
33
  ${item.content ? `<a class="bber-reply goComment" onclick="sco.toTalk('${item.content}')"><i class="scoicon sco-chat-fill" style="font-size: 1rem;"></i></a>` : ''}
34
34
  </div>
@@ -59,7 +59,7 @@ case theme.says.style
59
59
  <img class="no-lightbox no-lazyload avatar" src="!{theme.aside.card.author.img}">
60
60
  <div class="info">
61
61
  <span class="bber_nick">#{config.author}</span>
62
- <time class="datetime bber_date" datetime="${item.create_time}"></time>
62
+ <time class="datetime bber_date" datetime="${item.date}"></time>
63
63
  </div>
64
64
  ${item.content ? `<a class="bber-reply goComment" onclick="sco.toTalk('${item.content}')"><i class="scoicon sco-chat-fill" style="font-size: 1rem;"></i></a>` : ''}
65
65
  </div>
@@ -36,7 +36,7 @@ each item in site.data.essay.essay_list.slice(0, theme.says.strip)
36
36
  i.scoicon.sco-calendar-todo-fill
37
37
  time.datetime(datetime=moment(item.date).format())
38
38
  if item.link
39
- a.bber-content-link(href=url_for(item.link) title="跳转到短文指引的链接")
39
+ a.bber-content-link(href=url_for(item.link) title="跳转到短文指引的链接" target="_blank")
40
40
  i.scoicon.sco-link-m-line
41
41
  | 链接
42
42
  if item.content
@@ -11,66 +11,77 @@ div#rightMenu
11
11
  div.rightMenu-group.rightMenu-line.rightMenuPlugin
12
12
  div.rightMenu-item#menu-copytext
13
13
  i.scoicon.sco-copy-fill
14
- span 复制选中文本
14
+ span= _p('rightmenu.copytext')
15
15
  div.rightMenu-item#menu-pastetext
16
16
  i.scoicon.sco-clipboard-fill
17
- span 粘贴文本
17
+ span= _p('rightmenu.pastetext')
18
18
  if theme.comment.enable
19
19
  a.rightMenu-item#menu-commenttext
20
20
  i.scoicon.sco-chat-new-fill
21
- span 引用到评论
21
+ span= _p('rightmenu.commenttext')
22
22
  div.rightMenu-item#menu-newwindow
23
23
  i.scoicon.sco-window-fill
24
- span 新窗口打开
24
+ span= _p('rightmenu.newwindow')
25
25
  div.rightMenu-item#menu-copylink
26
26
  i.scoicon.sco-link-line
27
- span 复制链接地址
27
+ span= _p('rightmenu.copylink')
28
28
  div.rightMenu-item#menu-copyimg
29
29
  i.scoicon.sco-copy-fill
30
- span 复制此图片
30
+ span= _p('rightmenu.copyimg')
31
31
  div.rightMenu-item#menu-downloadimg
32
32
  i.scoicon.sco-download-cloud-fill
33
- span 下载此图片
33
+ span= _p('rightmenu.downloadimg')
34
34
  div.rightMenu-item#menu-search
35
35
  i.scoicon.sco-search-line
36
- span 站内搜索
37
- div.rightMenu-item#menu-searchBaidu
38
- i.scoicon.sco-baidu-fill
39
- span 百度搜索
36
+ span= _p('rightmenu.search')
40
37
  div.rightMenu-item#menu-music-toggle
41
38
  i.scoicon.sco-play-fill
42
- span 播放音乐
39
+ span= _p('rightmenu.music.toggle')
43
40
  div.rightMenu-item#menu-music-back
44
41
  i.scoicon.sco-skip-back-fill
45
- span 切换到上一首
42
+ span= _p('rightmenu.music.back')
46
43
  div.rightMenu-item#menu-music-forward
47
44
  i.scoicon.sco-skip-forward-fill
48
- span 切换到下一首
45
+ span= _p('rightmenu.music.forward')
49
46
  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');`)
50
47
  i.scoicon.sco-play-list-2-line
51
- span 查看所有歌曲
48
+ span= _p('rightmenu.music.playlist')
52
49
  div.rightMenu-item#menu-music-copyMusicName
53
50
  i.scoicon.sco-copy-fill
54
- span 复制歌名
51
+ span= _p('rightmenu.music.copyMusicName')
55
52
  div.rightMenu-group.rightMenu-line.rightMenuOther
56
53
  a.rightMenu-item.menu-Link#menu-randomPost
57
54
  i.scoicon.sco-signal-tower-fill
58
- span 随便逛逛
55
+ span= _p('rightmenu.randomPost')
59
56
  a.rightMenu-item.menu-link(href="/categories/")
60
57
  i.scoicon.sco-checkbox-multiple-blank-fill
61
- span 博客分类
58
+ span= _p('rightmenu.categories')
62
59
  a.rightMenu-item.menu-link(href="/tags/")
63
60
  i.scoicon.sco-price-tag-fill
64
- span 文章标签
61
+ span= _p('rightmenu.tags')
65
62
  div.rightMenu-group.rightMenu-line.rightMenuOther
66
63
  div.rightMenu-item#menu-copy
67
64
  i.scoicon.sco-external-link-fill
68
- span 复制地址
65
+ span= _p('rightmenu.copyaddress')
69
66
  if theme.comment.enable && theme.comment.commentBarrage
70
67
  div.rightMenu-item#menu-commentBarrage
71
68
  i.scoicon.sco-chat-fill
72
- span.menu-commentBarrage-text 关闭热评
69
+ span.menu-commentBarrage-text= _p('rightmenu.commentBarrage')
73
70
  div.rightMenu-item#menu-darkmode
74
71
  i.scoicon.sco-moon-clear-fill
75
- span.menu-darkmode-text 深色模式
72
+ case theme.display_mode.type
73
+ when 'auto'
74
+ when 'light'
75
+ span.menu-darkmode-text= _p('rightmenu.dark')
76
+ when 'dark'
77
+ span.menu-darkmode-text= _p('rightmenu.light')
78
+ if theme.translate.enable
79
+ div.rightMenu-item#menu-translate
80
+ case theme.translate.defaultEncoding
81
+ when 2
82
+ i.scoicon.sco-panben-line
83
+ span= _p('rightmenu.chs_to_cht')
84
+ when 1
85
+ i.scoicon.sco-jianben-line
86
+ span= _p('rightmenu.cht_to_chs')
76
87
  div#rightmenu-mask
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-solitude",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "A beautiful, powerful, and efficient Hexo theme developed by the DuoSco team",
5
5
  "main": "package.json",
6
6
  "scripts": {
package/plugins.yml CHANGED
@@ -90,11 +90,15 @@ snackbar:
90
90
  scoicon_css:
91
91
  name: solitude-source
92
92
  file: icon/scoicon.min.css
93
- version: 1.0.3
93
+ version: 1.0.5
94
94
  waterfall:
95
95
  name: solitude-source
96
96
  file: js/waterfall.min.js
97
- version: 1.0.3
97
+ version: 1.0.5
98
+ universe_js:
99
+ name: solitude-source
100
+ file: js/universe.min.js
101
+ version: 1.0.5
98
102
  medium_zoom:
99
103
  name: medium-zoom
100
104
  file: dist/medium-zoom.min.js
@@ -54,6 +54,11 @@ hexo.extend.filter.register('before_generate', () => {
54
54
  file: 'js/music.js',
55
55
  version
56
56
  },
57
+ translate:{
58
+ name: 'hexo-theme-solitude',
59
+ file: 'js/tw_cn.js',
60
+ version
61
+ },
57
62
  sco_ai_js: {
58
63
  name: 'hexo-theme-solitude',
59
64
  file: 'js/sco-ai.min.js',
@@ -1,22 +1,21 @@
1
1
  hexo.extend.filter.register('before_generate', () => {
2
- // Get first two digits of the Hexo version number
3
- const hexoVer = hexo.version.replace(/(^.*\..*)\..*/, '$1')
4
- const nodeVer = process.version.replace(/^v/, '');
5
- const [majorVer] = nodeVer.split('.');
6
- const logger = hexo.log, config = hexo.config
7
-
8
- if (hexoVer < 5.3) {
9
- logger.error('请把 Hexo 升级到 V5.3.0 或更高的版本!')
10
- process.exit(-1)
11
- }
2
+ const hexoVer = hexo.version.replace(/(^.*\..*)\..*/, '$1')
3
+ const nodeVer = process.version.replace(/^v/, '');
4
+ const [majorVer] = nodeVer.split('.');
5
+ const logger = hexo.log, config = hexo.config
6
+
7
+ if (hexoVer < 6.3) {
8
+ logger.error('请把 Hexo 升级到 V6.3.0 或更高的版本!')
9
+ process.exit(-1)
10
+ }
12
11
 
13
- if(config.prismjs.enable){
14
- logger.error('主题尚未支持 prismjs 请使用 highlightjs !')
15
- process.exit(-1)
12
+ if (config.prismjs.enable) {
13
+ logger.error('主题尚未支持 prismjs 请使用 highlightjs !')
14
+ process.exit(-1)
15
+ }
16
+ if (Number(majorVer) < 14) {
17
+ logger.error('请将 Node.js 升级到 v14.0.0 或更高的版本!');
18
+ process.exit(-1);
19
+ }
16
20
  }
17
- if (Number(majorVer) < 14) {
18
- logger.error('请将 Node.js 升级到 v14.0.0 或更高的版本!');
19
- process.exit(-1);
20
- }
21
- }
22
- )
21
+ )
@@ -1,4 +1,3 @@
1
- // generate 404 Page
2
1
  hexo.extend.generator.register('404', function (locals) {
3
2
  if(!this.theme.config.page.error)return
4
3
  return {
@@ -10,8 +9,6 @@ hexo.extend.generator.register('404', function (locals) {
10
9
  }
11
10
  }
12
11
  })
13
-
14
- // generate tags Page
15
12
  hexo.extend.generator.register('tags', function(locals) {
16
13
  if(!this.theme.config.page.tags)return
17
14
  return {
@@ -23,8 +20,6 @@ hexo.extend.generator.register('tags', function(locals) {
23
20
  }
24
21
  };
25
22
  });
26
-
27
- // generate categories Page
28
23
  hexo.extend.generator.register('categories', function(locals) {
29
24
  if(!this.theme.config.page.categories)return
30
25
  return {
@@ -1,12 +1,28 @@
1
1
  'use strict';
2
2
 
3
3
  hexo.extend.filter.register('before_post_render', () => {
4
- const logger = hexo.log;
5
- const theme = hexo.theme.config;
6
- if (theme.hometop.banner.enable && !theme.hometop.banner.icon) {
7
- logger.error('\n 启用banner的情况下,必须提供 icon 图片!\n 请在主题配置文件中设置 hometop.banner.icon 选项。');
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.');
9
- process.exit(-1);
4
+ const data = hexo.locals.get('data');
5
+ const logger = hexo.log;
6
+ const theme = hexo.theme.config;
7
+ if (theme.hometop.banner.enable && !theme.hometop.banner.icon) {
8
+ logger.error('\n 启用banner的情况下,必须提供 icon 图片!\n 请在主题配置文件中设置 hometop.banner.icon 选项。');
9
+ 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
+ process.exit(-1);
11
+ }
12
+ if (theme.says.enable && theme.says.mode === 'local' && !data.essay) {
13
+ logger.error('\n 启用说说的情况下,必须提供 essay 数据文件!\n 请新建 essay.yaml。');
14
+ logger.error('\n If says is enabled, essay data must be supplied! \n Please create essay.yaml.');
15
+ process.exit(-1);
16
+ }
17
+ if (theme.footer.randomlink && !data.links){
18
+ logger.error('\n 启用随机链接的情况下,必须提供 links 数据!\n 请新建 links.yaml。');
19
+ logger.error('\n If randomlink is enabled, links data must be supplied! \n Please create links.yaml.');
20
+ process.exit(-1);
21
+ }
22
+ if (theme.lightbox && !theme.fancybox && !theme.mediumZoom){
23
+ logger.error('\n 启用 lightbox 的情况下,必须提供 fancybox 或 mediumZoom 选项!\n 请在主题配置文件中设置 fancybox 或 mediumZoom 选项。');
24
+ logger.error('\n If lightbox is enabled, fancybox or mediumZoom option must be supplied! \n Please set the fancybox or mediumZoom option in the theme configuration file.');
25
+ process.exit(-1);
26
+ }
10
27
  }
11
- }
12
28
  );
@@ -1,9 +1,3 @@
1
- /**
2
- * Solitude
3
- * Related Posts
4
- * According the tag
5
- */
6
-
7
1
  'use strict'
8
2
 
9
3
  hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
@@ -1,13 +1,12 @@
1
1
  hexo.extend.filter.register('stylus:renderer', function (style) {
2
2
  const {config, theme} = this
3
+ const data = hexo.locals.get('data');
3
4
 
4
- // 侧边栏标签高亮
5
5
  if (theme.config.aside.tags.highlight) {
6
6
  let array = theme.config.aside.tags.list.map(item => encodeURIComponent(item));
7
7
  style.define('highlightTags', array);
8
8
  }
9
9
 
10
- // 侧边栏加载样式控制
11
10
  let aside = [
12
11
  theme.config.aside.home.noSticky,
13
12
  theme.config.aside.home.Sticky,
@@ -17,7 +16,13 @@ hexo.extend.filter.register('stylus:renderer', function (style) {
17
16
  theme.config.aside.page.noSticky
18
17
  ].join(',').split(',');
19
18
  let uniqueArr = [...new Set(aside)]; // 去重
20
- if (uniqueArr.length > 0) { // 是否为空
19
+ if (uniqueArr.length > 0) {
21
20
  style.define('aside', uniqueArr);
22
21
  }
22
+
23
+ if (data && data.about) {
24
+ style.define('about', Object.keys(data.about));
25
+ } else {
26
+ style.define('about', []);
27
+ }
23
28
  });
@@ -54,40 +54,41 @@ span.tags-punctuation::before
54
54
  line-height 32px
55
55
 
56
56
  // snackbar
57
- .snackbar-container
58
- background var(--sco-lighttext)!important
59
- color var(--sco-card-bg)!important
60
- border-radius 0!important
57
+ .snackbar-container
58
+ background var(--sco-lighttext) !important
59
+ color var(--sco-card-bg) !important
60
+ border-radius 0 !important
61
61
  display flex
62
- justify-content center!important
63
- max-width none!important
64
- min-width 100%!important
65
- margin 0!important
66
- left 0!important
67
- height 60px!important
68
- transform none!important
69
-
70
- .snackbar-container p
71
- color var(--sco-card-bg)!important
72
- font-weight 700!important
73
- text-align center!important
74
- font-size .8rem!important
75
- display flex!important
76
- justify-content center!important
77
-
78
- .snackbar-container .action
79
- color var(--sco-card-bg)!important
80
- background var(--sco-lighttext)!important
81
- padding 4px 6px!important
62
+ justify-content center !important
63
+ max-width none !important
64
+ min-width 100% !important
65
+ margin 0 !important
66
+ left 0 !important
67
+ height 60px !important
68
+ transform none !important
69
+
70
+ .snackbar-container p
71
+ color var(--sco-card-bg) !important
72
+ font-weight 700 !important
73
+ text-align center !important
74
+ font-size .8rem !important
75
+ display flex !important
76
+ justify-content center !important
77
+
78
+ .snackbar-container .action
79
+ color var(--sco-card-bg) !important
80
+ background var(--sco-lighttext) !important
81
+ padding 4px 6px !important
82
82
  font-weight 700
83
- border-radius 8px!important
83
+ border-radius 8px !important
84
84
  transition .3s
85
- border var(--style-border)!important
86
- .snackbar-container .action:hover
87
- color var(--sco-lighttext)!important
88
- background var(--sco-card-bg)!important
85
+ border var(--style-border) !important
86
+
87
+ .snackbar-container .action:hover
88
+ color var(--sco-lighttext) !important
89
+ background var(--sco-card-bg) !important
89
90
 
90
- .snackbar-container::after
91
+ .snackbar-container::after
91
92
  position absolute
92
93
  width 0
93
94
  height 100%
@@ -99,8 +100,27 @@ span.tags-punctuation::before
99
100
  animation snackbar-progress var(--sco-snackbar-time) linear forwards
100
101
  pointer-events none
101
102
 
102
- @keyframes snackbar-progress
103
- from
103
+ @keyframes snackbar-progress
104
+ from
104
105
  width 0
105
- to
106
- width 100%
106
+ to
107
+ width 100%
108
+
109
+ // universe
110
+ if hexo-config('display_mode.universe')
111
+ #universe
112
+ display block
113
+ position fixed
114
+ margin 0
115
+ padding 0
116
+ border 0
117
+ outline 0
118
+ left 0
119
+ top 0
120
+ width 100%
121
+ height 100%
122
+ pointer-events none
123
+ z-index 1
124
+ [data-theme=light]
125
+ #universe
126
+ display none
@@ -10,30 +10,40 @@
10
10
  margin 1rem 0
11
11
  line-height 1
12
12
 
13
- @import "tenyear"
13
+ if "tenyear" in about
14
+ @import "tenyear"
14
15
 
15
- @import "author"
16
+ if "authorinfo" in about
17
+ @import "author"
16
18
 
17
- @import "contentinfo"
19
+ if "contentinfo" in about
20
+ @import "contentinfo"
18
21
 
19
- @import "skills"
22
+ if "skills" in about
23
+ @import "skills"
20
24
 
21
- @import "oneself"
25
+ if "oneself" in about
26
+ @import "oneself"
22
27
 
23
- @import "buff"
28
+ if "motto" in about
29
+ @import "buff"
30
+ @import "maxim"
24
31
 
25
- @import "game"
32
+ if "game1" in about
33
+ @import "game"
26
34
 
27
- @import "personalities"
35
+ if "personalities" in about
36
+ @import "personalities"
37
+ @import "myphoto"
28
38
 
29
- @import "myphoto"
39
+ if "careers" in about
40
+ @import "careers"
30
41
 
31
- @import "careers"
42
+ if "likes" in about
43
+ @import "like"
32
44
 
33
- @import "like"
45
+ if "tj" in about
46
+ @import "statistic"
34
47
 
35
- @import "maxim"
36
-
37
- @import "statistic"
38
-
39
- @import "reward"
48
+ if "award" in about
49
+ @import "reward"
@@ -1,19 +1,24 @@
1
1
  #gallery
2
- width 100%
2
+ padding 16px 0
3
3
  display flex
4
4
  flex-wrap wrap
5
- justify-content start
6
- padding 10px 0
5
+ -webkit-box-pack start
6
+ justify-content flex-start
7
+ margin -8px
8
+ -webkit-box-align stretch
9
+ align-items stretch
7
10
 
8
11
  .gallery-item
9
12
  overflow hidden
10
13
  border var(--style-border-always)
11
14
  border-radius 12px
12
15
  position relative
16
+ float left
13
17
  display flex
14
18
  height 250px
15
- width calc(100% / 3 - 10px)
19
+ width calc(100% / 3 - 16px)
16
20
  cursor pointer
21
+ margin 8px
17
22
 
18
23
  &:hover
19
24
  .cover
@@ -65,7 +70,7 @@
65
70
  text-wrap break-word
66
71
 
67
72
  #album
68
- margin 22px auto 0
73
+ margin 5px auto
69
74
 
70
75
  .locate
71
76
  display flex
@@ -81,14 +86,12 @@
81
86
  z-index 1
82
87
  user-select none
83
88
 
84
- #sco-container
85
- margin-top 22px
86
-
87
89
  .sco-gallery-item
88
90
  margin-bottom 24px
89
91
  overflow hidden
90
92
  border-radius 8px
91
93
  transition all .3s
94
+ border var(--style-border-always)
92
95
 
93
96
  .sco-gallery-image
94
97
  width 100%
@@ -151,7 +151,7 @@
151
151
  top -132px
152
152
 
153
153
  .tk-row-actions-start
154
- top -210px
154
+ top -170px
155
155
 
156
156
  .tk-comments-title
157
157
  position absolute