hexo-theme-solitude 1.4.1 → 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 (68) 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 +68 -3
  5. package/languages/en-US.yml +32 -2
  6. package/languages/zh-CN.yml +33 -2
  7. package/languages/zh-TW.yml +147 -0
  8. package/layout/includes/console.pug +4 -0
  9. package/layout/includes/footer.pug +1 -1
  10. package/layout/includes/head/config.pug +16 -3
  11. package/layout/includes/inject/body.pug +18 -9
  12. package/layout/includes/keyboard.pug +65 -0
  13. package/layout/includes/layout.pug +8 -0
  14. package/layout/includes/page/album.pug +39 -0
  15. package/layout/includes/page/gallery.pug +11 -0
  16. package/layout/includes/page/links.pug +2 -0
  17. package/layout/includes/page/moment.pug +28 -0
  18. package/layout/includes/page/music.pug +1 -4
  19. package/layout/includes/page/says.pug +1 -3
  20. package/layout/includes/widgets/home/bb/json.pug +2 -1
  21. package/layout/includes/widgets/home/bb/local.pug +2 -3
  22. package/layout/includes/widgets/home/bb/memos.pug +2 -1
  23. package/layout/includes/widgets/page/about/authorinfo.pug +1 -1
  24. package/layout/includes/widgets/page/about/hobbies.pug +2 -2
  25. package/layout/includes/widgets/page/about/motto.pug +17 -15
  26. package/layout/includes/widgets/page/about/skillsinfo.pug +38 -36
  27. package/layout/includes/widgets/page/about/tenyear.pug +1 -1
  28. package/layout/includes/widgets/page/moments/angle.pug +19 -0
  29. package/layout/includes/widgets/page/says/json.pug +3 -3
  30. package/layout/includes/widgets/page/says/local.pug +2 -2
  31. package/layout/includes/widgets/rightside/index.pug +33 -22
  32. package/layout/includes/widgets/third-party/search/algolia-search.pug +20 -15
  33. package/layout/includes/widgets/third-party/search/local-search.pug +3 -0
  34. package/layout/page.pug +6 -0
  35. package/package.json +1 -1
  36. package/plugins.yml +12 -4
  37. package/scripts/event/cdn.js +5 -0
  38. package/scripts/event/init.js +18 -19
  39. package/scripts/event/page.js +0 -5
  40. package/scripts/filter/checkThemeConfig.js +23 -7
  41. package/scripts/helper/related_post.js +0 -6
  42. package/scripts/helper/stylus.js +8 -3
  43. package/source/css/_global/index.styl +1 -5
  44. package/source/css/_layout/basic.styl +0 -1
  45. package/source/css/_layout/index.styl +54 -34
  46. package/source/css/_mode/index.styl +6 -1
  47. package/source/css/_page/about/index.styl +26 -16
  48. package/source/css/_page/gallery/index.styl +99 -0
  49. package/source/css/_page/index.styl +5 -1
  50. package/source/css/_page/moment.styl +4 -2
  51. package/source/css/_widgets/_comment/twikoo.styl +21 -18
  52. package/source/css/_widgets/_mixins/keyboard.styl +59 -0
  53. package/source/css/_widgets/_search/algolia-search.styl +37 -16
  54. package/source/css/_widgets/_search/local-search.styl +18 -2
  55. package/source/css/_widgets/_tags/link.styl +1 -1
  56. package/source/css/_widgets/index.styl +4 -0
  57. package/source/css/index.styl +0 -1
  58. package/source/js/covercolor/api.js +10 -6
  59. package/source/js/covercolor/local.js +88 -13
  60. package/source/js/main.js +15 -1
  61. package/source/js/rightside.js +159 -342
  62. package/source/js/search/algolia.js +4 -2
  63. package/source/js/search/local.js +3 -1
  64. package/source/js/tw_cn.js +76 -0
  65. package/source/js/utils.js +1 -1
  66. package/layout/includes/page/not_configured.pug +0 -18
  67. package/scripts/helper/cdn.js +0 -12
  68. package/source/img/avatar.png +0 -0
package/CONTRIBUTING.md CHANGED
@@ -33,7 +33,7 @@ $ git push
33
33
  * 定期使用项目仓库内容更新自己仓库内容。
34
34
 
35
35
  ```bash
36
- $ git remote add upstream https://github.com/DuoSco/Hexo-theme-solitude
36
+ $ git remote add upstream https://github.com/wleelw/Hexo-theme-solitude
37
37
  $ git fetch upstream
38
38
  $ git checkout dev
39
39
  $ git rebase upstream/dev
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  ![master version](https://img.shields.io/github/package-json/v/wleelw/hexo-theme-solitude/master?color=%231ab1ad&label=master)
8
8
  ![master version](https://img.shields.io/github/package-json/v/wleelw/hexo-theme-solitude/dev?label=dev)
9
9
  ![https://img.shields.io/npm/v/hexo-theme-solitude?color=%09%23bf00ff](https://img.shields.io/npm/v/hexo-theme-solitude?color=%09%23bf00ff)
10
- ![hexo version](https://img.shields.io/badge/hexo-5.3.0+-0e83c)
10
+ ![hexo version](https://img.shields.io/badge/hexo-6.3.0+-0e83c)
11
11
  ![license](https://img.shields.io/github/license/wleelw/hexo-theme-solitude?color=FF5531)
12
12
 
13
13
  ![首页](https://github.com/wleelw/hexo-theme-solitude/assets/74389842/d008aba4-942d-4fdb-a611-d934c0bad9fe)
package/README_EN.md CHANGED
@@ -8,7 +8,7 @@
8
8
  ![master version](https://img.shields.io/github/package-json/v/wleelw/hexo-theme-solitude/master?color=%231ab1ad&label=master)
9
9
  ![master version](https://img.shields.io/github/package-json/v/wleelw/hexo-theme-solitude/dev?label=dev)
10
10
  ![https://img.shields.io/npm/v/hexo-theme-solitude?color=%09%23bf00ff](https://img.shields.io/npm/v/hexo-theme-solitude?color=%09%23bf00ff)
11
- ![hexo version](https://img.shields.io/badge/hexo-5.3.0+-0e83c)
11
+ ![hexo version](https://img.shields.io/badge/hexo-6.3.0+-0e83c)
12
12
  ![license](https://img.shields.io/github/license/wleelw/hexo-theme-solitude?color=FF5531)
13
13
 
14
14
  ![首页](https://github.com/wleelw/hexo-theme-solitude/assets/74389842/d008aba4-942d-4fdb-a611-d934c0bad9fe)
package/_config.yml CHANGED
@@ -62,7 +62,7 @@ nav:
62
62
  # icon: https://bu.dusays.com/2023/11/08/654af68b25bb8.jpg
63
63
  # # 点击的跳转链接
64
64
  # # Click the jump link
65
- # url: https://github.com/DuoSco/Hexo-Theme-solitude
65
+ # url: https://github.com/wleelw/Hexo-Theme-solitude
66
66
 
67
67
  # 导航栏内容
68
68
  # Navigation bar content
@@ -312,7 +312,7 @@ aside:
312
312
  # # 图标
313
313
  # icon: scoicon sco-github-line
314
314
  # # 跳转链接
315
- # url: https://github.com/DuoSco/Hexo-Theme-slitude
315
+ # url: https://github.com/wleelw/Hexo-Theme-slitude
316
316
  # Bilibili:
317
317
  # icon: scoicon sco-bilibili-line
318
318
  # url: https://space.bilibili.com/1329819902
@@ -468,6 +468,27 @@ capsule:
468
468
  server: netease # 播放列表的服务商。netease:网易云 / tencent:腾讯 / kugou:酷狗 / xiami:小米 / baidu:百度 : Music service provider. netease: Netease Cloud / tencent: Tencent / kugou: Kugou / xiaomi: Xiaomi / baidu: Baidu
469
469
  type: playlist # 播放列表的类型。song:单曲 / playlist:歌单 / album:专辑 / artist:歌手 : Type of playlist. song: Single / playlist: Playlist / album: Album / artist: Singer
470
470
 
471
+ # 友链鱼塘
472
+ # Links fish pond
473
+ moments:
474
+ enable: false # 是否开启鱼塘 / Whether to enable fish pond
475
+ api: # https://blog.wzsco.top/circle/ # api地址 / api address
476
+ error_img: https://bu.dusays.com/2023/11/08/654af68b25bb8.jpg # 加载失败显示图片 / Loading failed display image
477
+ sort_rule: created # 排序规则:created:按创建时间排序 / updated:按更新时间排序 : Sort rule: created: Sort by creation time / updated: Sort by update time
478
+ expire_days: 1 # 缓存过期时间(天),默认为1天 / Cache expiration time (days), default is 1 day
479
+ page_init_number: 10 # 页面初始化加载数量,默认为10条 / Page initialization loading quantity, default is 10
480
+ page_turning_number: 5 # 页面翻页加载数量,默认为5条 / Page turning loading quantity, default is 5
481
+ angle: true # 鱼塘随机文章 / Fish pond random article
482
+ appjs: https://cdn.cbd.int/solitude-source@1.0.3/js/fcircle.min.js # 鱼塘js / Fish pond js
483
+ bundlejs: https://cdn.cbd.int/solitude-source/js/moment/bundle.min.js # 鱼塘js / Fish pond js
484
+ randompostjs: https://cdn.cbd.int/solitude-source/js/moment/random_post.min.js # 鱼塘js / Fish pond js
485
+
486
+ # 相册
487
+ # album
488
+ album:
489
+ enable: false # 是否开启相册 / Whether to enable album
490
+ limit: 6 # 单行显示图片数量 / Number of pictures displayed in a single line
491
+
471
492
  # -------------------------
472
493
  # 文章页、页面配置
473
494
  # post、page settings
@@ -542,6 +563,35 @@ post:
542
563
  api: https://img2color.wzsco.top/api?img= # api地址 / api address
543
564
  time: 43200000 # api取色间隔(毫秒),默认为12小时 / api color interval (milliseconds), default is 12 hours
544
565
 
566
+ keyboard:
567
+ enable: false # 是否开启键盘控制 / Whether to enable keyboard control
568
+ # 键盘控制配置
569
+ # Keyboard control configuration
570
+ list:
571
+ # name: 按键名称
572
+ # name: Key name
573
+ # key: 按键
574
+ # key: Key
575
+ # func: 方法
576
+ # func: Function
577
+ # sco: sco内置方法
578
+ # sco: sco built-in method
579
+ # url: 跳转链接
580
+ # url: Jump link
581
+ # - name: 关闭快捷键功能
582
+ # key: K
583
+ # func: keyboard
584
+ # - name: 打开中控台
585
+ # key: A
586
+ # sco: showConsole
587
+ # - name: 播放/暂停音乐
588
+ # key: M
589
+ # sco: musicToggle
590
+ # - name: 打开友情链接
591
+ # key: L
592
+ # url: '/links/'
593
+
594
+
545
595
  # -------------------------
546
596
  # 自定义主题
547
597
 
@@ -567,6 +617,7 @@ theme_color:
567
617
  # --------------------------------------
568
618
  display_mode:
569
619
  type: auto # auto: 自动切换 / dark: 暗色模式 / light: 亮色模式 / auto: automatic switching / dark: dark mode / light: light mode
620
+ universe: true # 开启后暗色模式下会显示星空背景 / After opening, the dark mode will display the starry sky background
570
621
 
571
622
  # --------------------------------------
572
623
  # Footer Settings
@@ -679,6 +730,15 @@ fancybox: true
679
730
  # mediumZoom
680
731
  mediumZoom: false
681
732
 
733
+ # 简繁转换
734
+ # Simplified and Traditional Chinese conversion
735
+ translate:
736
+ enable: false
737
+ # the language of website (1 - Traditional Chinese/ 2 - Simplified Chinese)
738
+ defaultEncoding: 2
739
+ # Time delay
740
+ translateDelay: 0
741
+
682
742
  # Open Graph
683
743
  # https://ogp.me/
684
744
  # https://developers.facebook.com/docs/sharing/webmasters/
@@ -722,6 +782,11 @@ search:
722
782
  enable: false
723
783
  # algolia, local
724
784
  type: algolia
785
+ # 推荐标签
786
+ # Recommended tags
787
+ tags:
788
+ # - Solitude
789
+ # - Hexo
725
790
  algolia:
726
791
  # hits:
727
792
  # per_page: 6
@@ -856,7 +921,7 @@ CDN:
856
921
  option:
857
922
  scoicon_css: https://cdn.cbd.int/solitude-source/icon/scoicon.min.css
858
923
  waterfall: https://cdn.cbd.int/solitude-source/js/waterfall.min.js
859
- view_image: https://cdn.cbd.int/solitude-source/js/view-image.min.js
924
+ universe_js: https://cdn.cbd.int/solitude-source/js/universe.min.js
860
925
  # algolia_search:
861
926
  # instantsearch:
862
927
  # pjax:
@@ -13,6 +13,10 @@ time:
13
13
  daybefore: Days ago
14
14
  runtime: days
15
15
 
16
+ chs:
17
+ chs_tw: Traditional Chinese
18
+ chs_cn: Simplified Chinese
19
+
16
20
  page:
17
21
  tag: Tags
18
22
  category: Categories
@@ -71,7 +75,7 @@ search:
71
75
 
72
76
  head:
73
77
  noscript: Please enable JavaScript to view the site
74
- console: 'Program: Hexo | Theme: Hexo-Theme-Solitude | Author: WangZhuoSco、YiFeng | Github: https://github.com/DuoSco/Hexo-theme-solitude | Version: v1.4.1 😄'
78
+ console: 'Program: Hexo | Theme: Hexo-Theme-Solitude | Author: WangZhuoSco、YiFeng | Github: https://github.com/wleelw/Hexo-theme-solitude | Version: v1.4.3 😄'
75
79
 
76
80
  aside:
77
81
  postcount: 'Posts :'
@@ -93,6 +97,7 @@ console:
93
97
  tag_title: Find interesting areas
94
98
  switch_darkmode: Day and night switching
95
99
  switch_hideAside: Sidebar display control
100
+ switch_keyboard: Keyboard operation
96
101
  switch_music: Music switch
97
102
  archive_unit: Posts
98
103
 
@@ -114,4 +119,29 @@ cookies:
114
119
  privacy: How this site protects your privacy
115
120
 
116
121
  music:
117
- hit: Paused
122
+ hit: Paused
123
+
124
+ rightmenu:
125
+ copytext: Copy the selected
126
+ pastetext: Paste the text
127
+ commenttext: Quote to comment
128
+ newwindow: A new window opens
129
+ copylink: Copy the link address
130
+ copyimg: Copy this image
131
+ downloadimg: Download this image
132
+ search: Search on the site
133
+ music:
134
+ toggle: Play music
135
+ back: Switch to the previous track
136
+ forward: Switch to the next track
137
+ playlist: See all songs
138
+ copyMusicName: Reproduction Song Name
139
+ randomPost: Feel free to wander around
140
+ categories: Article classification
141
+ tags: Article tags
142
+ copyaddress: Copy the address
143
+ commentBarrage: Turn off trending reviews
144
+ dark: Dark
145
+ light: Light
146
+ chs_to_cht: Traditional
147
+ cht_to_chs: Simplified
@@ -1,3 +1,4 @@
1
+ # Language: 简体中文
1
2
  theme:
2
3
  dark: 已切换至深色模式
3
4
  light: 已切换至浅色模式
@@ -13,6 +14,10 @@ time:
13
14
  daybefore: 天前
14
15
  runtime: 天
15
16
 
17
+ chs:
18
+ chs_tw: 繁體中文
19
+ chs_cn: 简体中文
20
+
16
21
  page:
17
22
  tag: 标签
18
23
  category: 分类
@@ -70,7 +75,7 @@ search:
70
75
 
71
76
  head:
72
77
  noscript: 开启JavaScript才能访问本站哦~
73
- console: '程序:Hexo | 主题:Hexo-Theme-Solitude | 作者:王卓Sco、亦封 | Github: https://github.com/DuoSco/Hexo-theme-solitude | 版本:v1.4.1 😄'
78
+ console: '程序:Hexo | 主题:Hexo-Theme-Solitude | 作者:王卓Sco、亦封 | Github: https://github.com/wleelw/Hexo-theme-solitude | 版本:v1.4.3 😄'
74
79
 
75
80
  aside:
76
81
  postcount: '文章总数 :'
@@ -92,6 +97,7 @@ console:
92
97
  tag_title: 寻找感兴趣的领域
93
98
  switch_darkmode: 昼夜切换
94
99
  switch_hideAside: 边栏显示控制
100
+ switch_keyboard: 键盘快捷键
95
101
  switch_music: 音乐开关
96
102
  archive_unit: 篇
97
103
 
@@ -113,4 +119,29 @@ cookies:
113
119
  privacy: 本站如何保护你的隐私
114
120
 
115
121
  music:
116
- hit: 音乐已暂停
122
+ hit: 音乐已暂停
123
+
124
+ rightmenu:
125
+ copytext: 复制选中文本
126
+ pastetext: 粘贴文本
127
+ commenttext: 引用到评论
128
+ newwindow: 新窗口打开
129
+ copylink: 复制链接地址
130
+ copyimg: 复制此图片
131
+ downloadimg: 下载此图片
132
+ search: 站内搜索
133
+ music:
134
+ toggle: 播放音乐
135
+ back: 切换到上一首
136
+ forward: 切换到下一首
137
+ playlist: 查看所有歌曲
138
+ copyMusicName: 复制歌名
139
+ randomPost: 随便逛逛
140
+ categories: 文章分类
141
+ tags: 文章标签
142
+ copyaddress: 复制地址
143
+ commentBarrage: 关闭热评
144
+ dark: 深色模式
145
+ light: 浅色模式
146
+ chs_to_cht: 轉為繁體
147
+ cht_to_chs: 转为简体
@@ -0,0 +1,147 @@
1
+ # Language: 繁體中文 (台灣)
2
+ theme:
3
+ dark: 已切換至深色模式
4
+ light: 已切換至淺色模式
5
+
6
+ copy:
7
+ success: 複製成功
8
+ error: 複製失敗
9
+
10
+ time:
11
+ recent: 最近
12
+ yesterday: 昨天
13
+ berforeyesterday: 前天
14
+ daybefore: 天前
15
+ runtime: 天
16
+
17
+ chs:
18
+ chs_tw: 繁體中文
19
+ chs_cn: 簡體中文
20
+
21
+ page:
22
+ tag: 標籤
23
+ category: 分類
24
+ tags: 全部標籤
25
+ categories: 全部分類
26
+ archives: 文章
27
+ 404: 頁面沒有找到
28
+
29
+ nav:
30
+ site_name_title: 返回博客主頁
31
+ backtop: 返回頂部
32
+ travellings: 開往-友鏈接力
33
+ search: 搜索
34
+ randompost: 隨機一篇文章
35
+ console: 中控台
36
+
37
+ home:
38
+ bannertext: 隨便逛逛
39
+ categoryBar:
40
+ home: 首頁
41
+ more: 更多
42
+ recent-post:
43
+ sticky: 置頂
44
+ new: 最新
45
+ read: 未讀
46
+ top-group:
47
+ recommend: 荐
48
+ recommendmore: 更多推薦
49
+
50
+ post:
51
+ meta_reprint: 轉載或翻譯
52
+ meta_original: 原創
53
+ meta_cc: 該文章為${cc}文章,注意版權協議
54
+ meta_posted: 發布於
55
+ meta_updated: 最後更新於
56
+ meta_wordcount: 文章字數
57
+ meta_minread: 閱讀耗時
58
+ meta_ip: 作者IP歸屬地為
59
+ meta_pv: 文章熱度
60
+ meta_comment: 評論數
61
+
62
+ award:
63
+ wechat: 微信
64
+ alipay: 支付寶
65
+ about:
66
+ tip: 致謝
67
+ tip1: 贊助作者
68
+ tip2: 感謝你賜予我前進的力量
69
+ title: 贊助作者
70
+
71
+ search:
72
+ empty: 找不到你查詢的內容:${query}
73
+ hit: 找到 ${hits} 條結果,用時 ${time} 毫秒
74
+ placeholder: 輸入關鍵詞快速查找
75
+
76
+ head:
77
+ noscript: 開啟JavaScript才能訪問本站哦~
78
+ console: '程式:Hexo |主題:Hexo-Theme-Solitude |作者:王卓Sco、亦封 |Github位址: https://github.com/wleelw/Hexo-theme-solitude |版本:v1.4.3 😄'
79
+
80
+ aside:
81
+ postcount: '文章數:'
82
+ pv: '瀏覽量:'
83
+ uv: '訪客數:'
84
+ runtime: '運行時間:'
85
+ updatetime: '最後更新:'
86
+ wordcount: '字數統計:'
87
+ toc: 文章目錄
88
+ tagmore: 查看全部
89
+ avatar: 头像
90
+ sticker: 心情贴纸
91
+ newpost: 最近发布
92
+
93
+ console:
94
+ comment_tip: 互動
95
+ comment_title: 評論
96
+ tag_tip: 標籤
97
+ tag_title: 標籤
98
+ switch_darkmode: 昼夜切換
99
+ switch_hideAside: 边栏显示控制
100
+ switch_keyboard: 鍵盤快捷鍵
101
+ switch_music: 音樂開關
102
+ archive_unit: 篇
103
+
104
+ sidebar:
105
+ title1: 功能
106
+ title2: 標籤
107
+ darkmode: 顯示模式
108
+
109
+ footer:
110
+ description: 來自${title}的文章
111
+ learnmore: 了解更多
112
+ randomlink: 友鏈
113
+ rss: 訂閱
114
+ theme: 主題
115
+
116
+ cookies:
117
+ title: 協議提醒助手
118
+ tip: 查看本站為你的個人隱私做出的努力
119
+ privacy: 本站如何保護你的隱私
120
+
121
+ music:
122
+ hit: 音樂已暫停
123
+
124
+ rightmenu:
125
+ copytext: 複製選中文本
126
+ pastetext: 粘貼文本
127
+ commenttext: 引用到評論
128
+ newwindow: 新窗口打開
129
+ copylink: 複製連結位址
130
+ copyimg: 複製此圖片
131
+ downloadimg: 下載此圖片
132
+ search: 站內搜索
133
+ music:
134
+ toggle: 播放音樂
135
+ back: 切換到上一首
136
+ forward: 切換到下一首
137
+ playlist: 查看所有歌曲
138
+ copyMusicName: 複製歌名
139
+ randomPost: 随便逛逛
140
+ categories: 文章分類
141
+ tags: 文章標籤
142
+ copyaddress: 複製位址
143
+ commentBarrage: 關閉熱評
144
+ dark: 深色模式
145
+ light: 淺色模式
146
+ chs_to_cht: 轉為繁體
147
+ cht_to_chs: 转为简体
@@ -30,6 +30,10 @@ div#console
30
30
  div.console-btn-item#consoleHideAside
31
31
  a.asideSwitch(onclick="sco.switchHideAside()", title=_p('console.switch_hideAside'), href="javascript:void(0);")
32
32
  i.scoicon.sco-side-bar-fill
33
+ if theme.keyboard.enable
34
+ div.console-btn-item#consoleKeyboard(onclick="sco.switchKeyboard()")
35
+ a.keyboardSwitch(title=_p('console.switch_keyboard'), href="javascript:void(0);")
36
+ i.scoicon.sco-keyboard-box-fill
33
37
  if theme.capsule.enable
34
38
  div.console-btn-item#consoleMusic(onclick="sco.musicToggle()")
35
39
  a.music-switch(title=_p('console.switch_music'), href="javascript:void(0);")
@@ -51,7 +51,7 @@ div#footer-bar
51
51
  div.footer-bar-right
52
52
  if theme.footer.rss
53
53
  a.footer-bar-link(href=theme.footer.rss)= _p('footer.rss')
54
- a.footer-bar-link(href="https://github.com/DuoSco/hexo-theme-solitude")= _p('footer.theme')
54
+ a.footer-bar-link(href="https://github.com/wleelw/hexo-theme-solitude")= _p('footer.theme')
55
55
  if theme.site && theme.site.icp
56
56
  a.footer-bar-link(href=theme.site.icp_url || "https://beian.miit.gov.cn/#/Integrated/index")= theme.site.icp
57
57
  a.footer-bar-link.cc(href=theme.footer.license)
@@ -15,13 +15,21 @@
15
15
  apiKey: config.algolia.apiKey,
16
16
  indexName: config.algolia.indexName,
17
17
  hits: {
18
- per_page: theme?.search?.algolia_search?.hits?.per_page || 10
18
+ per_page: theme?.search?.algolia?.hits?.per_page || 10
19
19
  }
20
20
  })
21
21
  break;
22
22
  }
23
23
  }
24
24
 
25
+ let translate = 'undefined';
26
+ if (theme.translate && theme.translate.enable) {
27
+ translate = JSON.stringify({
28
+ defaultEncoding: theme.translate.defaultEncoding,
29
+ translateDelay: theme.translate.translateDelay,
30
+ })
31
+ }
32
+
25
33
  const commentInfoStart = theme.comment.randomInfoStart.map(item => `"${item}"`) || ""
26
34
  const commentInfoEnd = theme.comment.randomInfoEnd.map(item => `"${item}"`) || ""
27
35
  var sayhello2 = theme.aside.card.sayhello2.map(item => `"${item}"`) || []
@@ -64,6 +72,10 @@ script.
64
72
  empty: '!{_p('search.empty')}',
65
73
  hit: '!{_p('search.hit')}',
66
74
  placeholder: '!{_p('search.placeholder')}',
75
+ },
76
+ chs: {
77
+ chs_to_cht: '!{_p('chs.chs_tw')}',
78
+ cht_to_chs: '!{_p('chs.chs_cn')}',
67
79
  }
68
80
  },
69
81
  aside: {
@@ -93,7 +105,7 @@ script.
93
105
  url: '!{theme.comment.waline.envId}',
94
106
  }
95
107
  },
96
- lightbox: '!{ theme.mediumZoom ? "mediumZoom" : (theme.fancybox ? "fancybox" : "null" )}',
108
+ lightbox: '!{ theme.mediumZoom ? "mediumZoom" : (theme.fancybox ? "fancybox" : "null")}',
97
109
  rightside: {
98
110
  enable: !{theme.rightside.enable}
99
111
  },
@@ -105,5 +117,6 @@ script.
105
117
  },
106
118
  music: {
107
119
  enable: !{theme.music.enable},
108
- }
120
+ },
121
+ translate: !{translate},
109
122
  }
@@ -3,6 +3,21 @@
3
3
  div
4
4
  script(src=url_for(theme.cdn.main))
5
5
 
6
+ if theme.album.enable
7
+ script(src=url_for(theme.cdn.macy_js))
8
+
9
+ if theme.rightside.enable
10
+ include ../widgets/rightside/index
11
+ script(src=url_for(theme.cdn.rightside_js))
12
+
13
+ if theme.display_mode.universe
14
+ script(src=url_for(theme.cdn.universe_js))
15
+ script.
16
+ dark()
17
+
18
+ if theme.translate.enable
19
+ script(src=url_for(theme.cdn.translate))
20
+
6
21
  mixin katex
7
22
  link(rel="stylesheet", href=url_for(theme.cdn.katex))
8
23
  if theme.katex.copytex
@@ -34,10 +49,6 @@ div
34
49
  if theme.says.home_mini
35
50
  script(src=url_for(theme.cdn.swiper_js))
36
51
 
37
- if theme.rightside.enable
38
- include ../widgets/rightside/index
39
- script(src=url_for(theme.cdn.rightside_js))
40
-
41
52
  // post-ai)
42
53
  if theme.post_ai.enable
43
54
  script(src=url_for(theme.cdn.sco_ai_js))
@@ -84,11 +95,6 @@ div
84
95
  if theme.music.enable
85
96
  script(src=url_for(theme.cdn.music_js))
86
97
 
87
- // gallery
88
- if theme.gallery
89
- script(src=url_for(theme.cdn.fj_gallery))
90
- link(rel="stylesheet", href=url_for(theme.cdn.fj_gallery_css))
91
-
92
98
  // pace 胶囊加载条(Capsule loading bar)
93
99
  if theme.loading.pace
94
100
  script(src=url_for(theme.cdn.pace_js))
@@ -108,6 +114,9 @@ div
108
114
  != item
109
115
 
110
116
  div#js-pjax
117
+ if page.type === 'album' && theme.album.enable
118
+ script.
119
+ initGallery()
111
120
  if page.type === 'says' && theme.says.enable
112
121
  script.
113
122
  window.addEventListener('resize', utils.throttle(function () {
@@ -0,0 +1,65 @@
1
+ - const list = theme.keyboard.list || []
2
+ #keyboard-tips
3
+ .keyboardTitle= '博客快捷键'
4
+ .keyboardList
5
+ each item in list
6
+ .keyboardItem
7
+ .keyGroup
8
+ .key= 'Shift'
9
+ .key= item.key
10
+ .keyContent
11
+ .content= item.name
12
+ script.
13
+ const keyboard_addKeyup = (e) => {
14
+ if (e.key === 'Shift') {
15
+ document.getElementById('keyboard-tips').classList.remove('show');
16
+ }
17
+ }
18
+
19
+ const keyboard_addKeydown = (e) => {
20
+ const keyboards = !{JSON.stringify(list)};
21
+ if (e.keyCode === 16) {
22
+ document.getElementById('keyboard-tips').classList.add('show');
23
+ }
24
+
25
+ for (let i = 0; i < keyboards.length; i++) {
26
+ if (keyboards[i].url) {
27
+ if (keyboards[i].url.startsWith('http')) {
28
+ if (e.key === keyboards[i].key) {
29
+ window.open(keyboards[i].url);
30
+ }
31
+ } else {
32
+ if (e.key === keyboards[i].key) {
33
+ pjax.loadUrl(keyboards[i].url);
34
+ }
35
+ }
36
+ } else if (keyboards[i].sco) {
37
+ if (e.key === keyboards[i].key) {
38
+ sco[keyboards[i].sco]();
39
+ }
40
+ } else if (keyboards[i].func) {
41
+ if (e.key === keyboards[i].key) {
42
+ window[keyboards[i].func]();
43
+ }
44
+ }
45
+ }
46
+ }
47
+
48
+ function openKeyboard() {
49
+
50
+ window.addEventListener('keyup', keyboard_addKeyup);
51
+
52
+ window.addEventListener('keydown', keyboard_addKeydown);
53
+ }
54
+ function closeKeyboard() {
55
+
56
+ window.removeEventListener('keyup', keyboard_addKeyup);
57
+
58
+ window.removeEventListener('keydown', keyboard_addKeydown);
59
+ }
60
+
61
+ var sco_keyboards = localStorage.getItem('keyboard') === 'true'
62
+ if (sco_keyboards) {
63
+ openKeyboard();
64
+ document.getElementById('consoleKeyboard').classList.add('on');
65
+ }
@@ -5,6 +5,10 @@ html(lang=config.language, data-theme="light")
5
5
  head
6
6
  include ./head.pug
7
7
  body#body(data-type=page.type)
8
+ // universe
9
+ if theme.display_mode.universe
10
+ canvas#universe
11
+
8
12
  // loading
9
13
  if theme.loading.fullpage
10
14
  include ./loading.pug
@@ -15,6 +19,10 @@ html(lang=config.language, data-theme="light")
15
19
  // sidebar
16
20
  include ./sidebar.pug
17
21
 
22
+ // keyboard
23
+ if theme.keyboard.enable
24
+ include ./keyboard.pug
25
+
18
26
  #body-wrap(class = is_post() ? 'post' : 'page')
19
27
  include ./header.pug
20
28
 
@@ -0,0 +1,39 @@
1
+ include ../widgets/page/banner
2
+
3
+ - var gallery = site.data.gallery.gallery
4
+ - var album = gallery.find(item => item.album === page.album)
5
+ - var {limit} = theme.album
6
+
7
+ if album
8
+ #album
9
+ #sco-container
10
+ if album.json
11
+ script.
12
+ function initGallery() {
13
+ let macy = Macy({ container: '#sco-container', trueOrder: false, waitForImages: true, margin: 5, columns: !{limit}, breakAt: { 1200: 5, 940: 3, 520: 2, 400: 1 }})
14
+ macy.runOnImageLoad(function () { setTimeout(function () { GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll(".sco-gallery-item img")); macy.recalculate(true); }, 500); }, true)
15
+ }
16
+ (async function () {
17
+ await fetch('!{url_for(album.json)}')
18
+ .then(res => res.json())
19
+ .then(data => {
20
+ let html = ''
21
+ data = data.sort((a, b) => b.date - a.date)
22
+ data.forEach(item => { html += `<div class="sco-gallery-item"><span class="locate">${item.locate}</span><img class="sco-gallery-image" src="${item.image}" alt="${item.content}"></div>` })
23
+ document.querySelector('#sco-container').innerHTML = html
24
+ GLOBAL_CONFIG.lazyload.enable && utils.lazyloadImg();
25
+ initGallery()
26
+ })
27
+ })()
28
+
29
+ else
30
+ each item in album.items.sort((a, b) => b.date - a.date)
31
+ .sco-gallery-item
32
+ span.locate= item.locate
33
+ img.sco-gallery-image(src=item.image, alt=item.content)
34
+ script.
35
+ function initGallery(){
36
+ let macy = Macy({ container: '#sco-container', trueOrder: false, waitForImages: true, margin: 5, columns: !{limit}, breakAt: { 1200: 5, 940: 3, 520: 2, 400: 1 }})
37
+ macy.runOnImageLoad(function () { setTimeout(function () { GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll(".sco-gallery-item img")); macy.recalculate(true); }, 500); }, true)
38
+ }
39
+ document.addEventListener('DOMContentLoaded', initGallery);