hexo-theme-nblog 1.2.0 → 1.2.2

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/_config.yml CHANGED
@@ -63,8 +63,6 @@ footer_links:
63
63
  - name: 版权协议
64
64
  path: /posts/copyright/
65
65
 
66
- posts_per_page: 10
67
-
68
66
  twikoo:
69
67
  enable: false
70
68
  envId: https://xxx
@@ -26,10 +26,10 @@
26
26
  <%= theme.author || config.author %>
27
27
  </span>. All rights reserved.
28
28
  </p>
29
- <div class="footer__busuanzi">
30
- <span id="busuanzi_container_site_pv">本站总访问量 <span id="busuanzi_value_site_pv"></span> 次</span>
31
- <span class="footer__busuanzi-divider">|</span>
32
- <span id="busuanzi_container_site_uv">访客数 <span id="busuanzi_value_site_uv"></span> 人次</span>
29
+ <div class="footer__vercount">
30
+ <span id="vercount_container_site_pv">本站总访问量 <span id="vercount_value_site_pv"></span> 次</span>
31
+ <span class="footer__vercount-divider">|</span>
32
+ <span id="vercount_container_site_uv">访客数 <span id="vercount_value_site_uv"></span> 人次</span>
33
33
  </div>
34
34
  </div>
35
35
  <div class="footer__right">
@@ -46,4 +46,4 @@
46
46
  </div>
47
47
  </div>
48
48
  </footer>
49
- <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
49
+ <script async src="https://cn.vercount.one/js"></script>
@@ -1,8 +1,6 @@
1
1
  <% var license=page.license || theme.default_license || 'CC BY-NC-SA 4.0' ; var author=page.author || theme.author ||
2
2
  config.author || '作者' ; var isOriginal=page.original !==false; var sourceUrl=page.source_url || '' ; var
3
- licenseInfo={ 'CC BY-NC-SA 4.0' : { name: 'CC BY-NC-SA 4.0' ,
4
- url: 'https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh' , desc: '署名-非商业性使用-相同方式共享 4.0 国际' } }; var
5
- currentLicense=licenseInfo[license] || licenseInfo['CC BY-NC-SA 4.0']; %>
3
+ currentLicense=license || 'CC BY-NC-SA 4.0' ; %>
6
4
  <div class="post-license animate-fade-in-up animate-delay-2">
7
5
  <div class="post-license__header">
8
6
  <span class="copyright-symbol">©</span>
@@ -33,8 +31,8 @@
33
31
  <% } %>
34
32
  <div class="post-license__notice">
35
33
  <% if (isOriginal) { %>
36
- 本文为作者原创文章,遵循 <a href="<%= currentLicense.url %>" target="_blank" rel="noopener">
37
- <%= currentLicense.name %>
34
+ 本文为作者原创文章,遵循 <a target="_blank" rel="noopener">
35
+ <%= currentLicense %>
38
36
  </a> 许可协议,转载请注明出处。
39
37
  <% } else { %>
40
38
  本文仅供学习交流使用,版权归原作者所有,侵权请联系删除
package/layout/layout.ejs CHANGED
@@ -51,11 +51,7 @@
51
51
  }
52
52
  </style>
53
53
  <link rel="icon" type="image/svg+xml" href="/favicon.svg">
54
- <link rel="preconnect" href="https://fonts.googleapis.com">
55
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
56
- <link
57
- href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Noto+Sans+SC:wght@400;500;700&display=swap"
58
- rel="stylesheet">
54
+ <link rel="preload" href="<%= url_for('/css/main.css') %>" as="style">
59
55
  <link rel="stylesheet" href="<%= url_for('/css/main.css') %>">
60
56
  <% if (theme.lazyload && theme.lazyload.enable) { %>
61
57
  <link rel="stylesheet" href="<%= url_for('/css/lazyload.css') %>">
@@ -64,7 +60,7 @@
64
60
  <link rel="stylesheet" href="<%= url_for('/css/markdown.css') %>">
65
61
  <link rel="stylesheet" href="<%= url_for('/css/highlight.css') %>">
66
62
  <link rel="stylesheet" href="<%= url_for('/css/admonition.css') %>">
67
- <% if (theme.twikoo && theme.twikoo.enable) { %>
63
+ <% if (theme.twikoo && theme.twikoo.enable && page.comments !==false) { %>
68
64
  <link rel="stylesheet" href="<%= url_for('/css/twikoo.css') %>">
69
65
  <% } %>
70
66
  <% } %>
@@ -105,78 +101,59 @@
105
101
  </main>
106
102
  <%- partial('_partial/footer') %>
107
103
  </div>
108
- <script src="<%= url_for('/js/main.js') %>"></script>
104
+ <script defer src="<%= url_for('/js/main.js') %>"></script>
109
105
  <% if (theme.lazyload && theme.lazyload.enable) { %>
110
- <script src="<%= url_for('/js/lazyload.js') %>"></script>
111
- <script>
112
- document.addEventListener('DOMContentLoaded', function () {
113
- if (typeof initLazyload === 'function') {
114
- initLazyload({
115
- rootMargin: '100px 0px',
116
- threshold: 0.01
117
- });
118
- }
119
- });
120
- document.addEventListener('pjax:complete', function () {
121
- if (typeof refreshLazyload === 'function') {
122
- refreshLazyload();
123
- }
124
- });
125
- </script>
106
+ <script defer src="<%= url_for('/js/lazyload.js') %>"></script>
126
107
  <% } %>
127
108
  <% if (theme.medium_zoom && theme.medium_zoom.enable) { %>
128
- <script src="https://cdn.jsdelivr.net/npm/medium-zoom@1.1.0/dist/medium-zoom.min.js"></script>
129
- <script>
130
- document.addEventListener('DOMContentLoaded', function () {
131
- if (typeof initMediumZoom === 'function') {
132
- initMediumZoom();
133
- }
134
- });
135
- document.addEventListener('pjax:complete', function () {
136
- if (typeof initMediumZoom === 'function') {
137
- initMediumZoom();
138
- }
139
- });
140
- </script>
109
+ <script defer src="<%= url_for('/lib/js/medium-zoom.min.js') %>"></script>
141
110
  <% } %>
142
111
  <% if (theme.pjax && theme.pjax.enable) { %>
143
- <script src="https://cdn.jsdelivr.net/npm/pjax@0.2.8/pjax.min.js"></script>
112
+ <script defer src="<%= url_for('/lib/js/pjax.min.js') %>"></script>
144
113
  <script>
145
- var pjax = new Pjax({
146
- selectors: [
147
- 'title',
148
- 'meta[name="description"]',
149
- 'meta[property="og:title"]',
150
- 'meta[property="og:description"]',
151
- 'meta[property="og:url"]',
152
- 'meta[property="og:image"]',
153
- 'meta[property="article:published_time"]',
154
- 'meta[property="article:modified_time"]',
155
- '#pjax-container',
156
- '#header'
157
- ],
158
- cacheBust: false
159
- });
114
+ document.addEventListener('DOMContentLoaded', function () {
115
+ if (typeof Pjax !== 'undefined') {
116
+ var pjax = new Pjax({
117
+ selectors: [
118
+ 'title',
119
+ 'meta[name="description"]',
120
+ 'meta[property="og:title"]',
121
+ 'meta[property="og:description"]',
122
+ 'meta[property="og:url"]',
123
+ 'meta[property="og:image"]',
124
+ 'meta[property="article:published_time"]',
125
+ 'meta[property="article:modified_time"]',
126
+ '#pjax-container',
127
+ '#header'
128
+ ],
129
+ cacheBust: false
130
+ });
160
131
 
161
- document.addEventListener('pjax:complete', function () {
162
- if (typeof initPage === 'function') {
163
- initPage();
164
- }
165
- if (typeof twikoo !== 'undefined' && twikoo.init) {
166
- twikoo.init({
167
- envId: '<%= theme.twikoo.envId %>',
168
- el: '#twikoo-comment'
132
+ document.addEventListener('pjax:complete', function () {
133
+ if (typeof initPage === 'function') {
134
+ initPage();
135
+ }
136
+ if (typeof twikoo !== 'undefined' && twikoo.init && document.querySelector('#twikoo-comment')) {
137
+ twikoo.init({
138
+ envId: '<%= theme.twikoo.envId %>',
139
+ el: '#twikoo-comment'
140
+ });
141
+ }
169
142
  });
170
143
  }
171
144
  });
172
145
  </script>
173
146
  <% } %>
174
- <% if (is_post() && theme.twikoo && theme.twikoo.enable) { %>
175
- <script src="https://cdn.jsdelivr.net/npm/twikoo@1.6.39/dist/twikoo.all.min.js"></script>
147
+ <% if (is_post() && theme.twikoo && theme.twikoo.enable && page.comments !==false) { %>
148
+ <script defer src="<%= url_for('/lib/js/twikoo.all.min.js') %>"></script>
176
149
  <script>
177
- twikoo.init({
178
- envId: '<%= theme.twikoo.envId %>',
179
- el: '#twikoo-comment'
150
+ document.addEventListener('DOMContentLoaded', function () {
151
+ if (typeof twikoo !== 'undefined' && twikoo.init) {
152
+ twikoo.init({
153
+ envId: '<%= theme.twikoo.envId %>',
154
+ el: '#twikoo-comment'
155
+ });
156
+ }
180
157
  });
181
158
  </script>
182
159
  <% } %>
package/layout/post.ejs CHANGED
@@ -20,8 +20,7 @@
20
20
  <header class="post-header animate-fade-in-up">
21
21
  <% if (page.cover) { %>
22
22
  <div class="post-header__cover">
23
- <img data-src="<%= page.cover %>" alt="<%= page.title %>" <%=theme.medium_zoom && theme.medium_zoom.enable
24
- ? ' data-zoomable' : '' %>>
23
+ <img data-src="<%= page.cover %>" alt="<%= page.title %>">
25
24
  </div>
26
25
  <% } %>
27
26
  <h1 class="post-header__title">
@@ -128,7 +127,7 @@
128
127
  </nav>
129
128
  </div>
130
129
 
131
- <% if (theme.twikoo && theme.twikoo.enable) { %>
130
+ <% if (theme.twikoo && theme.twikoo.enable && page.comments !== false) { %>
132
131
  <section class="post-comments animate-fade-in-up animate-delay-4">
133
132
  <div id="twikoo-comment"></div>
134
133
  </section>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-nblog",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "A lightweight and minimalist blog theme",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -32,7 +32,7 @@ hexo.extend.filter.register('after_post_render', function (data) {
32
32
  }
33
33
  }
34
34
 
35
- return '<img' + before + 'data-src="' + src + '"' + newAfter + '>';
35
+ return '<img' + before + 'src="data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 1 1\'%3E%3C/svg%3E" data-src="' + src + '"' + newAfter + '>';
36
36
  });
37
37
  }
38
38
 
@@ -8,7 +8,6 @@
8
8
  box-shadow: var(--shadow-sm);
9
9
  overflow: hidden;
10
10
  border: 1px solid var(--border-color);
11
- border-left: 4px solid var(--admonition-color, var(--primary-color));
12
11
  transition: all var(--transition-normal);
13
12
  }
14
13
 
@@ -25,7 +24,7 @@
25
24
  font-weight: 600;
26
25
  font-size: 0.95rem;
27
26
  color: var(--admonition-color, var(--primary-color));
28
- margin: 0;
27
+ margin: 0 !important;
29
28
  transition: background var(--transition-fast);
30
29
  }
31
30
 
@@ -39,7 +38,7 @@
39
38
  }
40
39
 
41
40
  .admonition-content {
42
- padding: 12px 16px;
41
+ padding: 16px 12px;
43
42
  color: var(--text-primary);
44
43
  }
45
44
 
@@ -66,6 +65,7 @@
66
65
  }
67
66
 
68
67
  .admonition.anote .admonition-title {
68
+ margin-bottom: 0em;
69
69
  color: var(--primary-dark);
70
70
  }
71
71
 
@@ -1,10 +1,10 @@
1
1
  .highlight {
2
- background: #282c34;
2
+ background: var(--surface-color);
3
3
  border-radius: 10px;
4
4
  margin: 1em 0;
5
5
  overflow-x: auto;
6
6
  position: relative;
7
- font-family: Consolas, Menlo, 'Fira Code', monospace;
7
+ font-family: 'Fira Code', Consolas, Menlo, monospace;
8
8
  }
9
9
 
10
10
  .highlight .gutter {
@@ -1,7 +1,6 @@
1
1
  .lazyload-wrapper {
2
2
  position: relative;
3
3
  overflow: hidden;
4
- background: var(--surface-color);
5
4
  border-radius: var(--border-radius);
6
5
  }
7
6
 
@@ -10,15 +9,18 @@
10
9
  }
11
10
 
12
11
  img[data-src] {
13
- opacity: 0 !important;
14
- visibility: hidden !important;
12
+ opacity: 0;
15
13
  min-height: 1px;
16
14
  min-width: 1px;
17
15
  }
18
16
 
19
17
  img[data-src].lazyload-image {
20
- visibility: visible !important;
21
18
  opacity: 0;
19
+ transition: opacity 0.3s ease;
20
+ }
21
+
22
+ img[data-src].lazyload-loaded {
23
+ opacity: 1;
22
24
  }
23
25
 
24
26
  .lazyload-skeleton {
@@ -147,11 +149,6 @@ img[data-src].lazyload-image {
147
149
  border-radius: 50%;
148
150
  }
149
151
 
150
- .markdown-body .lazyload-wrapper,
151
- .post-body .lazyload-wrapper {
152
- margin: 16px 0;
153
- }
154
-
155
152
  .markdown-body .lazyload-image,
156
153
  .post-body .lazyload-image {
157
154
  display: block;
@@ -22,7 +22,7 @@
22
22
  --transition-fast: 0.15s ease;
23
23
  --transition-normal: 0.3s ease;
24
24
  --transition-slow: 0.5s ease;
25
- --font-family: 'Roboto', 'Noto Sans SC', sans-serif;
25
+ --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
26
26
  --font-mono: 'Fira Code', 'Consolas', monospace;
27
27
  --header-height: 64px;
28
28
  --sidebar-width: 280px;
@@ -130,7 +130,7 @@ button {
130
130
  }
131
131
 
132
132
  .material-card:hover {
133
- transform: translateY(-2px);
133
+ transform: translateY(-1px);
134
134
  box-shadow: var(--shadow-lg);
135
135
  }
136
136
 
@@ -505,6 +505,7 @@ button {
505
505
  display: flex;
506
506
  justify-content: space-between;
507
507
  align-items: flex-end;
508
+ white-space: nowrap;
508
509
  }
509
510
 
510
511
  .footer__left {
@@ -532,7 +533,7 @@ button {
532
533
 
533
534
  .footer__copyright,
534
535
  .footer__themeInfo {
535
- font-size: 14px;
536
+ font-size: 12px;
536
537
  color: var(--text-secondary);
537
538
  display: flex;
538
539
  flex-direction: row;
@@ -560,7 +561,7 @@ button {
560
561
 
561
562
  .footer__links a {
562
563
  padding: 0;
563
- font-size: 13px;
564
+ font-size: 11px;
564
565
  text-decoration: none;
565
566
  transition: color var(--transition-fast);
566
567
  }
@@ -583,12 +584,12 @@ button {
583
584
  .footer__rss,
584
585
  .footer__sitemap {
585
586
  color: var(--primary-color);
586
- font-size: 14px;
587
+ font-size: 12px;
587
588
  text-decoration: none;
588
589
  }
589
590
 
590
591
  .footer__powered {
591
- font-size: 13px;
592
+ font-size: 11px;
592
593
  color: var(--text-secondary);
593
594
  display: flex;
594
595
  align-items: center;
@@ -599,17 +600,17 @@ button {
599
600
  text-decoration: none;
600
601
  }
601
602
 
602
- .footer__busuanzi {
603
- font-size: 14px;
603
+ .footer__vercount {
604
+ font-size: 12px;
604
605
  color: var(--text-secondary);
605
606
  }
606
607
 
607
- .footer__busuanzi #busuanzi_value_site_pv,
608
- .footer__busuanzi #busuanzi_value_site_uv {
608
+ .footer__vercount #vercount_value_site_pv,
609
+ .footer__vercount #vercount_value_site_uv {
609
610
  color: var(--primary-dark);
610
611
  }
611
612
 
612
- .footer__busuanzi-divider {
613
+ .footer__vercount-divider {
613
614
  margin: 0 8px;
614
615
  }
615
616
 
@@ -760,15 +761,10 @@ button {
760
761
  .notification-banner__content {
761
762
  position: relative;
762
763
  min-height: 44px;
763
- cursor: grab;
764
764
  user-select: none;
765
765
  transition: height 0.3s ease;
766
766
  }
767
767
 
768
- .notification-banner__content:active {
769
- cursor: grabbing;
770
- }
771
-
772
768
  .notification-banner__item {
773
769
  position: absolute;
774
770
  top: 0;
@@ -1027,6 +1023,21 @@ button {
1027
1023
  border-color: var(--primary-color);
1028
1024
  }
1029
1025
 
1026
+ .pagination .space {
1027
+ display: inline-flex;
1028
+ align-items: center;
1029
+ justify-content: center;
1030
+ min-width: 40px;
1031
+ height: 40px;
1032
+ padding: 0 12px;
1033
+ border-radius: var(--border-radius-sm);
1034
+ font-size: 14px;
1035
+ color: var(--text-secondary);
1036
+ background: var(--surface-color);
1037
+ border: 1px solid var(--border-color);
1038
+ transition: all var(--transition-fast);
1039
+ }
1040
+
1030
1041
  .page-header {
1031
1042
  text-align: center;
1032
1043
  padding: 40px 0;
@@ -1159,7 +1170,7 @@ button {
1159
1170
  }
1160
1171
 
1161
1172
  .post-footer__tag {
1162
- font-size: 14px;
1173
+ font-size: 12px;
1163
1174
  color: var(--primary-color);
1164
1175
  padding: 4px 12px;
1165
1176
  background: var(--border-color);
@@ -2238,22 +2249,8 @@ html:hover {
2238
2249
  position: relative;
2239
2250
  z-index: 1;
2240
2251
  white-space: nowrap;
2241
- transition: color var(--transition-fast);
2242
2252
  }
2243
2253
 
2244
2254
  .post-license__notice a::before {
2245
- content: '';
2246
- position: absolute;
2247
- bottom: 0;
2248
- left: 0;
2249
- width: 100%;
2250
- height: 0;
2251
- background: var(--btn-plain-bg-hover);
2252
- transition: height var(--transition-fast);
2253
- transform-origin: bottom;
2254
- z-index: -1;
2255
- }
2256
-
2257
- .post-license__notice a:hover::before {
2258
- height: 100%;
2255
+ height: 0%;
2259
2256
  }