hexo-theme-solitude 1.6.0 → 1.7.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.
Files changed (83) hide show
  1. package/README.md +1 -1
  2. package/README_zh-cn.md +1 -1
  3. package/README_zh-tw.md +1 -1
  4. package/SECURITY.md +5 -5
  5. package/_config.yml +50 -51
  6. package/languages/en.yml +59 -63
  7. package/languages/zh-CN.yml +52 -55
  8. package/languages/zh-TW.yml +52 -55
  9. package/layout/404.pug +1 -1
  10. package/layout/category.pug +1 -1
  11. package/layout/includes/console.pug +13 -12
  12. package/layout/includes/footer.pug +6 -6
  13. package/layout/includes/head/config.pug +70 -38
  14. package/layout/includes/head/opengraph.pug +2 -2
  15. package/layout/includes/head/pwa.pug +6 -6
  16. package/layout/includes/head.pug +1 -1
  17. package/layout/includes/inject/body.pug +7 -7
  18. package/layout/includes/inject/head.pug +35 -1
  19. package/layout/includes/keyboard.pug +1 -1
  20. package/layout/includes/nav.pug +1 -1
  21. package/layout/includes/sidebar.pug +19 -3
  22. package/layout/includes/widgets/home/categoryBar.pug +2 -2
  23. package/layout/includes/widgets/home/postList.pug +4 -4
  24. package/layout/includes/widgets/home/topGroup.pug +2 -2
  25. package/layout/includes/widgets/nav/group.pug +2 -2
  26. package/layout/includes/widgets/nav/right.pug +1 -1
  27. package/layout/includes/widgets/page/about/award.pug +8 -9
  28. package/layout/includes/widgets/page/about/hobbies.pug +1 -1
  29. package/layout/includes/widgets/page/about/other.pug +1 -1
  30. package/layout/includes/widgets/page/banner.pug +1 -1
  31. package/layout/includes/widgets/page/links/banner.pug +5 -4
  32. package/layout/includes/widgets/page/moments/angle.pug +1 -1
  33. package/layout/includes/widgets/post/award.pug +10 -15
  34. package/layout/includes/widgets/post/copyright.pug +2 -2
  35. package/layout/includes/widgets/post/postMeta.pug +17 -10
  36. package/layout/includes/widgets/randomlink.pug +3 -2
  37. package/layout/includes/widgets/third-party/comments/comment.pug +5 -7
  38. package/layout/includes/widgets/third-party/comments/twikoo.pug +1 -0
  39. package/layout/includes/widgets/third-party/comments/valine.pug +44 -0
  40. package/layout/includes/widgets/third-party/comments/waline.pug +40 -11
  41. package/layout/includes/widgets/third-party/news-comment/newest-comment.pug +5 -3
  42. package/layout/includes/widgets/third-party/news-comment/twikoo.pug +12 -10
  43. package/layout/includes/widgets/third-party/news-comment/valine.pug +79 -0
  44. package/layout/includes/widgets/third-party/news-comment/waline.pug +25 -20
  45. package/layout/page.pug +3 -0
  46. package/layout/tag.pug +1 -1
  47. package/package.json +1 -1
  48. package/plugins.yml +15 -3
  49. package/scripts/event/cdn.js +9 -9
  50. package/scripts/event/init.js +4 -2
  51. package/scripts/event/merge_config.js +15 -6
  52. package/scripts/helper/related_post.js +2 -2
  53. package/scripts/tags/tabs.js +1 -1
  54. package/source/css/_comments/{index.styl → comment.styl} +15 -22
  55. package/source/css/_comments/twikoo.styl +3 -0
  56. package/source/css/_comments/valine.styl +245 -0
  57. package/source/css/_global/index.styl +3 -0
  58. package/source/css/_highlight/highlight/index.styl +1 -1
  59. package/source/css/_highlight/prismjs/line-number.styl +1 -1
  60. package/source/css/_layout/article-sort.styl +1 -1
  61. package/source/css/_layout/aside.styl +3 -3
  62. package/source/css/_layout/console.styl +7 -6
  63. package/source/css/_layout/footer.styl +1 -0
  64. package/source/css/_layout/header.styl +2 -0
  65. package/source/css/_layout/sidebar.styl +30 -20
  66. package/source/css/_page/_home/home-top.styl +1 -1
  67. package/source/css/_page/_home/recent-post.styl +2 -2
  68. package/source/css/_page/index.styl +1 -4
  69. package/source/css/_page/links.styl +5 -5
  70. package/source/css/_post/content.styl +26 -7
  71. package/source/css/_post/tools.styl +3 -9
  72. package/source/css/index.styl +1 -3
  73. package/source/img/flower.gif +0 -0
  74. package/source/js/{comment/twikoo_commentBarrage.js → commentBarrage/twikoo.js} +4 -10
  75. package/source/js/commentBarrage/valine.js +156 -0
  76. package/source/js/{comment/waline_commentBarrage.js → commentBarrage/waline.js} +3 -5
  77. package/source/js/main.js +92 -96
  78. package/source/js/third_party/efu_ai.min.js +6 -0
  79. package/source/js/utils.js +15 -2
  80. package/layout/includes/widgets/rightside/index.pug +0 -87
  81. package/source/css/_comments/waline.styl +0 -455
  82. package/source/js/rightside.js +0 -221
  83. package/source/js/third_party/sco-ai.min.js +0 -8
@@ -1,14 +1,15 @@
1
1
  div#console
2
2
  div.close-btn(onclick="sco.hideConsole()")
3
3
  i.solitude.st-close-fill
4
- if theme.comment.newComment
4
+ if theme.console_plus
5
5
  div.console-card-group
6
- div.console-card-group-left
7
- div.console-card#card-newest-comments(onclick="sco.hideConsole()")
8
- div.card-content
9
- div.author-content-item-tips= _p('console.comment_tip')
10
- div.author-content-item-title= _p('console.comment_title')
11
- div.aside-list
6
+ if theme.console_plus && theme.comment.newest_comment.enable
7
+ div.console-card-group-left
8
+ div.console-card#card-newest-comments(onclick="sco.hideConsole()")
9
+ div.card-content
10
+ div.author-content-item-tips= _p('console.comment_tip')
11
+ div.author-content-item-title= _p('console.comment_title')
12
+ div.aside-list
12
13
 
13
14
  div.console-card-group-right
14
15
  div.console-card.tags(onclick="sco.hideConsole()")
@@ -25,21 +26,21 @@ div#console
25
26
 
26
27
  div.button-group
27
28
  div.console-btn-item
28
- a.darkmode_switchbutton(onclick="sco.switchDarkMode()", title=_p('console.switch_darkmode'), href="javascript:void(0);")
29
+ span.darkmode_switchbutton(onclick="sco.switchDarkMode()", title=_p('console.switch_darkmode'))
29
30
  i.solitude.st-moon-clear-fill
30
31
  div.console-btn-item#consoleHideAside
31
- a.asideSwitch(onclick="sco.switchHideAside()", title=_p('console.switch_hideAside'), href="javascript:void(0);")
32
+ span.asideSwitch(onclick="sco.switchHideAside()", title=_p('console.switch_hideAside'))
32
33
  i.solitude.st-side-bar-fill
33
34
  if theme.keyboard.enable
34
35
  div.console-btn-item#consoleKeyboard(onclick="sco.switchKeyboard()")
35
- a.keyboardSwitch(title=_p('console.switch_keyboard'), href="javascript:void(0);")
36
+ span.keyboardSwitch(title=_p('console.switch_keyboard'))
36
37
  i.solitude.st-keyboard-box-fill
37
38
  if theme.capsule.enable
38
39
  div.console-btn-item#consoleMusic(onclick="sco.musicToggle()")
39
- a.music-switch(title=_p('console.switch_music'), href="javascript:void(0);")
40
+ span.music-switch(title=_p('console.switch_music'))
40
41
  i.solitude.st-disc-fill
41
42
  if theme.comment.enable && theme.comment.commentBarrage
42
43
  div.console-btn-item.on#consoleCommentBarrage(onclick="sco.switchCommentBarrage()")
43
- a.commentBarrage
44
+ span.commentBarrage
44
45
  i.solitude.st-chat-fill
45
46
  div.console-mask(onclick="sco.hideConsole()")
@@ -7,7 +7,7 @@ div#st-footer-bar
7
7
  else if theme.site.name.class === 'text'
8
8
  span.solitude= theme.site.name.custom
9
9
  div.footer-bar-description= __('footer.description').replace(/\$\{title}/, config.title + " - " + config.subtitle)
10
- a.footer-bar-link(href="/")= __('footer.learnmore')
10
+ a.footer-bar-link(href=url_for('/'))= __('footer.learnmore')
11
11
  div#footer_deal
12
12
  - var leftInfo = theme.footer && theme.footer.information && theme.footer.information.left || {}
13
13
  - var rightInfo = theme.footer && theme.footer.information && theme.footer.information.right || {}
@@ -38,7 +38,7 @@ div#st-footer
38
38
  div.footer-group
39
39
  div.footer-title-group
40
40
  h3.footer-title= _p('footer.randomlink')
41
- a.random-friends-btn(href="javascript:randomLinksList();")
41
+ button.random-friends-btn(onclick='randomLinksList()', title=_p('footer.randomlink'))
42
42
  i.solitude.st-refresh-line
43
43
  div.footer-links#friend-links-in-footer
44
44
  div#footer-bar
@@ -46,14 +46,14 @@ div#footer-bar
46
46
  div.footer-bar-left
47
47
  if moment(theme.aside.siteinfo.runtime).year() === new Date().getFullYear()
48
48
  div.copyright © #{moment(theme.aside.siteinfo.runtime).year()} By 
49
- a.footer-bar-link(href="/")= config.author
49
+ a.footer-bar-link(href=url_for("/"))= config.author
50
50
  else
51
51
  div.copyright © #{moment(theme.aside.siteinfo.runtime).year()} - #{new Date().getFullYear()} By 
52
- a.footer-bar-link(href="/")= config.author
52
+ a.footer-bar-link(href=url_for("/"))= config.author
53
53
  div.footer-bar-right
54
54
  each item in theme.footer.links
55
55
  a.footer-bar-link(href=url_for(item.url), title=item.name)= item.name
56
- a.footer-bar-link.cc(href=theme.footer.license)
56
+ a.footer-bar-link.cc(href=url_for(theme.footer.license), aria-label = 'copyright')
57
57
  i.solitude.st-copyright-line
58
58
  i.solitude.st-creative-commons-by-line
59
59
  i.solitude.st-creative-commons-nc-line
@@ -63,7 +63,7 @@ if theme.footer.privacy
63
63
  div.cookies-window-title= __('cookies.title')
64
64
  div.cookies-window-content
65
65
  span.cookies-tip= __('cookies.tip')
66
- a.cookies-link(href=theme.footer.privacy, title=_p('cookies.privacy'))
66
+ a.cookies-link(href=url_for(theme.footer.privacy), title=_p('cookies.privacy'))
67
67
  i.solitude.st-right-btn-fill
68
68
  if theme.comment.enable && theme.comment.commentBarrage
69
69
  div.comment-barrage.needEndHide
@@ -22,17 +22,69 @@
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
- });
25
+ const sayhello2 = theme.aside.card.sayhello2.map(item => `"${item}"`) || [];
26
+
27
+ let comment = false
28
+
29
+ if (theme.comment.type === 'twikoo') {
30
+ comment = JSON.stringify({
31
+ avatar: theme.comment.avatar,
32
+ url: theme.comment.twikoo.envId,
33
+ commentBarrage: theme.comment.enable,
34
+ accessToken: theme.comment.twikoo.accessToken,
35
+ owo: {
36
+ body: '.OwO-body',
37
+ item: '.OwO-items li'
38
+ }
39
+ })
31
40
  }
32
41
 
33
- const commentInfoStart = theme.comment.randomInfoStart.map(item => `"${item}"`) || [];
34
- const commentInfoEnd = theme.comment.randomInfoEnd.map(item => `"${item}"`) || [];
35
- const sayhello2 = theme.aside.card.sayhello2.map(item => `"${item}"`) || [];
42
+ if (theme.comment.type === 'waline') {
43
+ comment = JSON.stringify({
44
+ avatar: theme.comment.avatar,
45
+ url: theme.comment.waline.envId,
46
+ commentBarrage: theme.comment.enable,
47
+ owo: {
48
+ body: '.wl-emoji-popup',
49
+ item: '.wl-tab-wrapper button'
50
+ }
51
+ })
52
+ }
53
+
54
+ if (theme.comment.type === 'valine') {
55
+ comment = JSON.stringify({
56
+ avatar: theme.comment.avatar,
57
+ url: theme.comment.valine.serverURLs,
58
+ commentBarrage: theme.comment.enable,
59
+ appId: theme.comment.valine.appId,
60
+ appKey: theme.comment.valine.appKey,
61
+ owo: {
62
+ body: '.vwrap',
63
+ item: '.vemojis i'
64
+ }
65
+ })
66
+ }
67
+
68
+ let post_ai = false
69
+
70
+ if (theme.post_ai.enable) {
71
+ post_ai = JSON.stringify({
72
+ key: theme.post_ai.key,
73
+ talk: theme.post_ai.talk,
74
+ randomPost: theme.post_ai.randomPost,
75
+ })
76
+ }
77
+
78
+ let copyright = false;
79
+ if (theme.copy.enable && theme.copy.copyright.enable) {
80
+ copyright = JSON.stringify({
81
+ limit: theme.copy.copyright.limit,
82
+ author: _p("copy_copyright.author") + ': ' + config.author,
83
+ link: _p("copy_copyright.link") + ': ',
84
+ source: _p("copy_copyright.source") + ': ' + config.title,
85
+ info: _p("copy_copyright.info")
86
+ })
87
+ }
36
88
 
37
89
  script.
38
90
  const GLOBAL_CONFIG = {
@@ -44,6 +96,7 @@ script.
44
96
  enable: !{theme.lazyload.enable},
45
97
  error: '!{theme.lazyload.errorimg}'
46
98
  },
99
+ copyright: !{copyright},
47
100
  highlight: {
48
101
  enable: !{theme.highlight.enable},
49
102
  limit: !{theme.highlight.limit},
@@ -51,7 +104,7 @@ script.
51
104
  copy: !{theme.highlight.copy},
52
105
  syntax: '!{config.syntax_highlighter}'
53
106
  },
54
- randomlinks: !{theme.footer.randomlink},
107
+ randomlink: !{theme.footer.randomlink},
55
108
  lang: {
56
109
  theme: {
57
110
  dark: '!{_p('theme.dark')}',
@@ -80,7 +133,11 @@ script.
80
133
  chs: {
81
134
  chs_to_cht: '!{_p('chs.chs_tw')}',
82
135
  cht_to_chs: '!{_p('chs.chs_cn')}',
83
- }
136
+ },
137
+ barrage: {
138
+ title: '!{_p('commentBarrage.title')}',
139
+ },
140
+ f12: '!{_p('f12')}',
84
141
  },
85
142
  aside: {
86
143
  sayhello: {
@@ -95,32 +152,7 @@ script.
95
152
  covercolor: {
96
153
  enable: !{theme.post.covercolor.enable}
97
154
  },
98
- comment: {
99
- enable: !{theme.comment.enable},
100
- type: '!{theme.comment.type}',
101
- commentBarrage: !{theme.comment.commentBarrage && theme.comment.enable},
102
- randomInfoStart: [!{commentInfoStart}],
103
- randomInfoEnd: [!{commentInfoEnd}],
104
- twikoo: {
105
- url: '!{theme.comment.twikoo.envId}',
106
- accessToken: '!{theme.comment.twikoo.accessToken}'
107
- },
108
- waline: {
109
- url: '!{theme.comment.waline.envId}',
110
- }
111
- },
155
+ comment: !{comment},
112
156
  lightbox: '!{ theme.mediumZoom ? "mediumZoom" : (theme.fancybox ? "fancybox" : "null")}',
113
- rightside: {
114
- enable: !{theme.rightside.enable}
115
- },
116
- ai: {
117
- enable: !{theme.post_ai.enable},
118
- key: '!{theme.post_ai.key}',
119
- talk: '!{theme.post_ai.talk}',
120
- randomPost: !{theme.post_ai.randomPost},
121
- },
122
- music: {
123
- enable: !{theme.music.enable},
124
- },
125
- translate: !{translate},
157
+ post_ai: !{post_ai}
126
158
  };
@@ -1,10 +1,10 @@
1
- if theme.opengraph.enable
1
+ if theme.OpenGraph.enable
2
2
  -
3
3
  const coverVal = page.cover || theme.site.siteIcon
4
4
  let ogOption = {
5
5
  type: is_post() ? 'article' : 'website',
6
6
  image: coverVal ? full_url_for(coverVal) : '',
7
- ...theme.opengraph.options
7
+ ...theme.OpenGraph.options
8
8
  }
9
9
  -
10
10
  != open_graph(ogOption)
@@ -4,16 +4,16 @@ if theme.pwa.enable
4
4
  if theme.pwa.theme_color
5
5
  meta(name="msapplication-TileColor" content=theme.pwa.theme_color)
6
6
  if theme.pwa.mask_icon
7
- link(rel="mask-icon", href=theme.pwa.mask_icon, color=theme.pwa.theme_color)
7
+ link(rel="mask-icon", href=url_for(theme.pwa.mask_icon), color=theme.pwa.theme_color)
8
8
  if theme.pwa.apple_touch_icon
9
9
  link(rel="apple-touch-icon" sizes="180x180" href=url_for(theme.pwa.apple_touch_icon))
10
10
  if theme.pwa.favicon_16_16
11
- link(rel="icon", type="image/png", sizes="16x16", href=theme.pwa.favicon_16_16)
11
+ link(rel="icon", type="image/png", sizes="16x16", href=url_for(theme.pwa.favicon_16_16))
12
12
  if theme.pwa.favicon_32_32
13
- link(rel="icon", type="image/png", sizes="32x32", href=theme.pwa.favicon_32_32)
13
+ link(rel="icon", type="image/png", sizes="32x32", href=url_for(theme.pwa.favicon_32_32))
14
14
  if theme.pwa.bookmark_icon
15
- link(rel="bookmark", href=theme.pwa.bookmark_icon)
15
+ link(rel="bookmark", href=url_for(theme.pwa.bookmark_icon))
16
16
  else
17
17
  meta(name="apple-mobile-web-app-capable", content=config.title)
18
- link(rel="bookmark", href=theme.site.siteIcon)
19
- link(rel="apple-touch-icon", href=theme.site.siteIcon, sizes="180x180")
18
+ link(rel="bookmark", href=url_for(theme.site.siteIcon))
19
+ link(rel="apple-touch-icon", href=url_for(theme.site.siteIcon), sizes="180x180")
@@ -17,7 +17,7 @@ meta(name="viewport" content="width=device-width, initial-scale=1")
17
17
 
18
18
  title= title + subtitle
19
19
  noscript= _p('head.noscript')
20
- link(rel="icon", href=theme.site.siteIcon)
20
+ link(rel="icon", href=url_for(theme.site.siteIcon))
21
21
 
22
22
  // index.css
23
23
  link(rel="stylesheet", href=url_for(theme.cdn.main_css))
@@ -14,16 +14,16 @@ div
14
14
  script(src=url_for(theme.cdn.main))
15
15
  script(src=url_for(theme.cdn.utils))
16
16
 
17
+ if theme.comment.enable && theme.comment.type === 'valine'
18
+ // md5
19
+ script(src=url_for(theme.cdn.blueimp_md5))
20
+
17
21
  // lately
18
22
  script(src=url_for(theme.cdn.lately_js))
19
23
 
20
24
  if theme.mermaid
21
25
  script(src=url_for(theme.cdn.mermaid_js))
22
26
 
23
- if theme.rightside.enable
24
- include ../widgets/rightside/index
25
- script(src=url_for(theme.cdn.rightside_js))
26
-
27
27
  if theme.display_mode.universe
28
28
  script(src=url_for(theme.cdn.universe_js))
29
29
  script.
@@ -51,7 +51,7 @@ div
51
51
  script(src=url_for(theme.cdn.swiper_js))
52
52
 
53
53
  if theme.post_ai.enable
54
- script(src=url_for(theme.cdn.sco_ai_js))
54
+ script(src=url_for(theme.cdn.efu_ai))
55
55
 
56
56
  if theme.capsule.enable || theme.music.enable
57
57
  script(src=url_for(theme.cdn.aplayer_js))
@@ -78,14 +78,14 @@ div
78
78
  case theme.comment.type
79
79
  when 'twikoo'
80
80
  script(src=url_for(theme.cdn.twikoo))
81
- when 'waline'
82
- script(src=url_for(theme.cdn.waline_js))
83
81
  if theme.comment.commentBarrage
84
82
  case theme.comment.type
85
83
  when 'twikoo'
86
84
  script(src=url_for(theme.cdn.twikoo_commentBarrage))
87
85
  when 'waline'
88
86
  script(src=url_for(theme.cdn.waline_commentBarrage))
87
+ when 'valine'
88
+ script(src=url_for(theme.cdn.valine_commentBarrage))
89
89
 
90
90
  if theme.music.enable
91
91
  script(src=url_for(theme.cdn.music_js))
@@ -73,11 +73,45 @@ script.
73
73
  document.documentElement.classList.remove('hide-aside')
74
74
  }
75
75
  }
76
+
77
+ win.getCSS = (url, id = false) => new Promise((resolve, reject) => {
78
+ const link = document.createElement('link')
79
+ link.rel = 'stylesheet'
80
+ link.href = url
81
+ if (id) link.id = id
82
+ link.onerror = reject
83
+ link.onload = link.onreadystatechange = function () {
84
+ const loadState = this.readyState
85
+ if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
86
+ link.onload = link.onreadystatechange = null
87
+ resolve()
88
+ }
89
+ document.head.appendChild(link)
90
+ })
91
+
92
+ win.getScript = (url, attr = {}) => new Promise((resolve, reject) => {
93
+ const script = document.createElement('script')
94
+ script.src = url
95
+ script.async = true
96
+ script.onerror = reject
97
+ script.onload = script.onreadystatechange = function () {
98
+ const loadState = this.readyState
99
+ if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
100
+ script.onload = script.onreadystatechange = null
101
+ resolve()
102
+ }
103
+
104
+ Object.keys(attr).forEach(key => {
105
+ script.setAttribute(key, attr[key])
106
+ })
107
+
108
+ document.head.appendChild(script)
109
+ })
76
110
  }
77
111
  )(window)
78
112
 
79
113
  console.log(
80
- "%c Program: Hexo %c Theme: Solitude %c Version: v1.6.0",
114
+ "%c Program: Hexo %c Theme: Solitude %c Version: v1.7.0",
81
115
  "border-radius:5px 0 0 5px;padding: 5px 10px;color:white;background:#ff3842;",
82
116
  "padding: 5px 10px;color:white;background:#3e9f50;",
83
117
  "border-radius:0 5px 5px 0;padding: 5px 10px;background:#0084ff;color:white;"
@@ -1,6 +1,6 @@
1
1
  - const list = theme.keyboard.list || []
2
2
  #keyboard-tips
3
- .keyboardTitle= '博客快捷键'
3
+ .keyboardTitle=_p('keyboard.title')
4
4
  .keyboardList
5
5
  each item in list
6
6
  .keyboardItem
@@ -5,7 +5,7 @@ nav#nav.show
5
5
  .back-home-button(tabindex="-1")
6
6
  i.back-home-button-icon.solitude.st-more-fill
7
7
  include ./widgets/nav/group
8
- a#site-name(href="/", title=_p('nav.site_name_title'))
8
+ a#site-name(href=url_for("/"), title=_p('nav.site_name_title'))
9
9
  if theme.site.name.class === 'i_class'
10
10
  i.solitude(class=theme.site.name.custom, style="font-size: 16px;")
11
11
  else if theme.site.name.class === 'img'
@@ -1,14 +1,30 @@
1
1
  div#sidebar(style="zoom: 1;")
2
2
  div#menu-mask(style="display: none;")
3
3
  div#sidebar-menus
4
- span.sidebar-menu-item-title= __('sidebar.title1')
4
+ .site-data
5
+ .data-item.is-center
6
+ .data-item-link
7
+ a(href=url_for('/archives/'))
8
+ .headline=_p('page.archives')
9
+ .length-num=site.posts.find({ parent: { $exists: false } }).length
10
+ .data-item.is-center
11
+ .data-item-link
12
+ a(href=url_for('/categories/'))
13
+ .headline=_p('page.category')
14
+ .length-num=site.categories.find({parent: {$exists: false}}).length
15
+ .data-item.is-center
16
+ .data-item-link
17
+ a(href=url_for('/tags/'))
18
+ .headline=_p('page.tag')
19
+ .length-num=site.tags.find({parent: {$exists: false}}).length
20
+ span.sidebar-menu-item-title= __('sidebar.function')
5
21
  div.sidebar-menu-item
6
- a.darkmode_switchbutton.menu-child(onclick="sco.switchDarkMode()", href="javascript:void(0);")
22
+ span.darkmode_switchbutton.menu-child(onclick="sco.switchDarkMode()")
7
23
  i.solitude.st-moon-clear-fill
8
24
  span= __('sidebar.darkmode')
9
25
  include ./widgets/nav/group
10
26
  include ./widgets/nav/menu.pug
11
- span.sidebar-menu-item-title= __('sidebar.title2')
27
+ span.sidebar-menu-item-title= __('page.tag')
12
28
  div.card-widget.card-tags.card-archives.card-webinfo.card-allinfo
13
29
  div.card-tag-cloud
14
30
  each tag in site.tags.find({ parent: { $exists: false } }).data
@@ -1,6 +1,6 @@
1
1
  .category-bar-items#category-bar-items
2
2
  .category-bar-item(class=is_home() ? 'select' : '', id="category-bar-home")
3
- a(href="/")= __('home.categoryBar.home')
3
+ a(href=url_for('/'))= __('home.home')
4
4
  each item in site.categories.find({ parent: { $exists: false } }).data
5
5
  .category-bar-item(class=select ? (select === item.name ? 'select' : '') : '', id=item.name)
6
6
  a(href=url_for(item.path))= item.name
@@ -8,4 +8,4 @@ div.category-bar-right
8
8
  if site.categories.find({parent: {$exists: false}}).data.length > 10
9
9
  .category-bar-next#category-bar-next(onclick="sco.scrollCategoryBarToRight()")
10
10
  i.solitude.st-show-right-line
11
- a.category-bar-more(href="/categories/")= __('home.categoryBar.more')
11
+ a.category-bar-more(href=url_for('/categories/'))= __('more')
@@ -8,14 +8,14 @@ mixin info
8
8
  if post.sticky && is_home()
9
9
  span.article-meta.sticky-warp
10
10
  i.solitude.st-thumbtack-solid.sticky.orange
11
- span.sticky.orange= _p('home.recent-post.sticky')
11
+ span.sticky.orange= _p('home.sticky')
12
12
  each category in post.categories.data
13
13
  span.original= category.name
14
14
 
15
15
  if post.prev == null && is_home()
16
- span.original= _p('home.recent-post.new')
16
+ span.original= _p('home.new')
17
17
 
18
- a.unvisited-post(href=url_for(post.path))= _p('home.recent-post.read')
18
+ a.unvisited-post(href=url_for(post.path))= _p('home.read')
19
19
 
20
20
  a.article-title(href=url_for(post.path), title=post.title)= post.title
21
21
 
@@ -41,7 +41,7 @@ mixin info
41
41
  div.article-meta-wrap
42
42
  span.article-meta.tags
43
43
  each tag in post.tags.data
44
- a.article-meta__tags(href=tag.path, onclick="event.stopPropagation();")
44
+ a.article-meta__tags(href=url_for(tag.path), onclick="event.stopPropagation();")
45
45
  span.tags-punctuation=tag.name
46
46
 
47
47
  span.post-meta-date
@@ -3,7 +3,7 @@ each post in filteredPosts
3
3
  .recent-post-item
4
4
  .post_cover
5
5
  a(href=url_for(post.path), title=post.title)
6
- span.recent-post-top-text= _p('home.top-group.recommend')
6
+ span.recent-post-top-text= _p('home.recommend')
7
7
  img.post_bg(alt=post.title, src=post.cover)
8
8
  .recent-post-info
9
9
  a.article-title(href=url_for(post.path), title=post.title)= post.title
@@ -16,7 +16,7 @@ mixin todayCardContent
16
16
  .banner-button-group
17
17
  a.banner-button(onclick="window.event.cancelBubble=true;sco.hideTodayCard();")
18
18
  i.solitude.st-add-fill
19
- span.banner-button-text= _p('home.top-group.recommendmore')
19
+ span.banner-button-text= _p('home.recommendmore')
20
20
 
21
21
  case theme.hometop.recommendList.url.startsWith('/')
22
22
  when true
@@ -7,7 +7,7 @@ if menu
7
7
  .back-menu-list
8
8
  each data, label in value
9
9
  - var array = data.split('||')
10
- a.back-menu-item(href=url_for(trim(array[0])), title=index)
10
+ a.back-menu-item(href=url_for(trim(array[0])), title=label)
11
11
  if array[1]
12
- img.nolazyload.back-menu-item-icon(src=trim(array[1]), alt=index)
12
+ img.nolazyload.back-menu-item-icon(src=trim(array[1]), alt=label)
13
13
  span.back-menu-item-text= label
@@ -1,7 +1,7 @@
1
1
  - var custom = theme.nav.right.custom || []
2
2
  each item in custom
3
3
  .nav-button(id=item.id)
4
- a.site-page(href=item.url || 'javascript:void(0);', onclick=item.onclick, title=item.title || '')
4
+ a.site-page(href=url_for(item.url) || 'javascript:void(0);', onclick=item.onclick, title=item.title || '')
5
5
  i.solitude(class=item.icon || '')
6
6
  if theme.nav.right.random
7
7
  .nav-button#randomPost_button
@@ -4,8 +4,8 @@
4
4
  if site.data.about.rewardList
5
5
  .author-content
6
6
  .author-content-item.single.reward
7
- .author-content-item-tips= _p('award.about.tip')
8
- span.author-content-item-title= _p('award.about.title')
7
+ .author-content-item-tips= _p('award.thanks')
8
+ span.author-content-item-title= _p('award.title')
9
9
  .author-content-item-description
10
10
  = award.description
11
11
  .reward-list-all
@@ -22,18 +22,17 @@ if site.data.about.rewardList
22
22
  if theme.post.award.enable
23
23
  .post-reward
24
24
  .post-reward(onclick="AddRewardMask()")
25
- .reward-button(title=_p('award.about.tip1'))
25
+ .reward-button(title=_p('award.tipping'))
26
26
  i.solitude.st-hand-heart-fill
27
- = _p('award.about.tip1')
27
+ = _p('award.tipping')
28
28
  .reward-main
29
29
  ul.reward-all
30
- span.reward-title= _p('award.about.tip2')
30
+ span.reward-title= theme.post.award.title
31
31
  ul.reward-group
32
- - var rewards = [{image: theme.post.award.wechat, description: _p('award.wechat')}, {image: theme.post.award.alipay, description: _p('award.alipay')}]
32
+ - var rewards = theme.post.award.list
33
33
  each reward in rewards
34
34
  li.reward-item
35
- a(href=reward.image, target="_blank")
36
- img.post-qr-code-img(alt=reward.description, src=reward.image)
37
- .post-qr-code-desc= reward.description
35
+ img.post-qr-code-img(alt=reward.name, src=reward.qcode, style="border-color:" + reward.color)
36
+ .post-qr-code-desc= reward.name
38
37
  .reward-list-tips
39
38
  p= award.tips.replace('{sum}', sum.toFixed(2))
@@ -32,6 +32,6 @@ if site.data.about.likes
32
32
  .tips= like.subtips
33
33
  if like.button
34
34
  .banner-button-group
35
- a.banner-button(href=like.button_link)
35
+ a.banner-button(href=url_for(like.button_link))
36
36
  i.solitude.st-right-btn-fill
37
37
  span.banner-button-text= like.button_text
@@ -10,7 +10,7 @@
10
10
  #statistic
11
11
  .post-tips
12
12
  | 统计信息来自
13
- a(href="https://invite.51.la/1NzKqTeb?target=V6") 51la网站统计
13
+ a(href="https://v6.51.la/") 51la网站统计
14
14
 
15
15
  script.
16
16
  fetch("#{tj.url}")
@@ -10,6 +10,6 @@
10
10
  if page.rightbtn
11
11
  .banner-button-group
12
12
  - const isInternalLink = page.rightbtnlink.startsWith('/')
13
- a.banner-button(onclick=isInternalLink ? `pjax.loadUrl("${page.rightbtnlink}")` : null, href=isInternalLink ? null : page.rightbtnlink, target=isInternalLink ? null : "_blank")
13
+ a.banner-button(onclick=isInternalLink ? `pjax.loadUrl("${page.rightbtnlink}")`: null, href=isInternalLink ? null : url_for(page.rightbtnlink), target=isInternalLink ? null : "_blank")
14
14
  i.solitude.st-right-btn-fill
15
15
  span.banner-button-text= page.rightbtn
@@ -6,10 +6,11 @@
6
6
  if theme.footer.randomlink
7
7
  a.banner-button.secondary(onclick="travelling()")
8
8
  i.solitude.st-signal-tower-fill
9
- span.banner-button-text 随机访问
10
- a.banner-button(onclick="sco.scrollToComment()")
11
- i.solitude.st-right-btn-fill
12
- span.solitude.banner-button-text 申请友链
9
+ span.banner-button-text=_p('link.banner.random')
10
+ if theme.comment.enable
11
+ a.banner-button(onclick="sco.scrollToComment()")
12
+ i.solitude.st-right-btn-fill
13
+ span.solitude.banner-button-text=_p('link.banner.toComment')
13
14
 
14
15
  .tags-group-all.nowrapMove
15
16
  .tags-group-wrapper
@@ -5,7 +5,7 @@
5
5
  i.solitude.st-restart-line
6
6
  .title-h2-a-right
7
7
  if page.type !== 'links'
8
- a.random-post-all(href="/links/", data-pjax-state="") 全部友链
8
+ a.random-post-all(href=url_for("/links/"), data-pjax-state="") 全部友链
9
9
 
10
10
  #random-post
11
11
 
@@ -1,24 +1,19 @@
1
1
  .post-reward(onclick="AddRewardMask()")
2
- .reward-button(title="赞赏作者")
2
+ .reward-button(title=_p('award.tipping'))
3
3
  i.solitude.st-hand-heart-fill
4
- | 打赏作者
4
+ =_p('award.tipping')
5
5
  .reward-main
6
6
  ul.reward-all
7
- span.reward-title 感谢你赐予我前进的力量
7
+ span.reward-title=theme.post.award.title
8
8
  ul.reward-group
9
- if theme.post.award.wechat
9
+ - let list = theme.post.award.list || []
10
+ for item in list
10
11
  li.reward-item
11
- a(href=theme.post.award.wechat)
12
- img.post-qr-code-img(src=theme.post.award.wechat alt="微信")
13
- .post-qr-code-desc 微信
14
- if theme.post.award.alipay
15
- li.reward-item
16
- a(href=theme.post.award.alipay target="_blank")
17
- img.post-qr-code-img(src=theme.post.award.alipay alt="支付宝")
18
- .post-qr-code-desc 支付宝
19
- a.reward-main-btn(href=url_for(theme.post.award.url))
20
- .reward-text 赞赏者名单
21
- .reward-dec 因为你们的支持让我意识到写文章的价值🙏
12
+ img.post-qr-code-img.nolazyload(src=item.qcode, alt=item.name, style="border-color: " + item.color)
13
+ .post-qr-code-desc=item.name
14
+ a.reward-main-btn(href=url_for(theme.post.award.appreciators))
15
+ .reward-text= _p('award.title')
16
+ .reward-dec=theme.post.award.desc
22
17
 
23
18
  script.
24
19
  function RemoveRewardMask() {