hexo-theme-stellar 1.26.0 → 1.26.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
@@ -1,6 +1,6 @@
1
1
  ######## Stellar info ########
2
2
  stellar:
3
- version: '1.26.0'
3
+ version: '1.26.2'
4
4
  homepage: 'https://xaoxuu.com/wiki/stellar/'
5
5
  repo: 'https://github.com/xaoxuu/hexo-theme-stellar'
6
6
  cdn_css: # Use cdn links instead of /css/main.css
@@ -351,7 +351,7 @@ tag_plugins:
351
351
  plugins:
352
352
  ## required plugins ##
353
353
  # jquery
354
- jquery: https://gcore.jsdelivr.net/npm/jquery@3.6.2/dist/jquery.min.js
354
+ jquery: https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js
355
355
 
356
356
  # stellar api
357
357
  stellar:
@@ -371,16 +371,15 @@ plugins:
371
371
  # preload
372
372
  preload:
373
373
  enable: true
374
- service: flying_pages # instant_page, flying_pages
375
- instant_page: https://gcore.jsdelivr.net/gh/volantis-x/cdn-volantis@4.1.2/js/instant_page.js
376
- flying_pages: https://gcore.jsdelivr.net/gh/gijo-varghese/flying-pages@2.1.2/flying-pages.min.js
374
+ service: flying_pages # flying_pages
375
+ flying_pages: https://cdn.bootcdn.net/ajax/libs/flying-pages/2.1.2/flying-pages.min.js
377
376
 
378
377
  # image lazyload
379
378
  # https://www.npmjs.com/package/vanilla-lazyload
380
379
  lazyload:
381
380
  enable: true # [hexo clean && hexo s] is required after changing this value.
382
- js: https://gcore.jsdelivr.net/npm/vanilla-lazyload@17.8.3/dist/lazyload.min.js
383
- transition: blur # blur, fade
381
+ js: https://cdn.bootcdn.net/ajax/libs/vanilla-lazyload/17.8.4/lazyload.min.js
382
+ transition: fade # blur, fade
384
383
 
385
384
  # https://scrollrevealjs.org/api/reveal.html
386
385
  scrollreveal:
@@ -395,12 +394,12 @@ plugins:
395
394
  # available for {% image xxx %}
396
395
  fancybox:
397
396
  enable: true
398
- js: https://gcore.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.umd.js
399
- css: https://gcore.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.css
397
+ js: https://cdn.bootcdn.net/ajax/libs/fancyapps-ui/5.0.22/fancybox/fancybox.umd.min.js
398
+ css: https://cdn.bootcdn.net/ajax/libs/fancyapps-ui/5.0.22/fancybox/fancybox.min.css
400
399
  # 可以处理评论区的图片(不支持 iframe 类评论系统)例如:
401
400
  # 使用twikoo评论可以写: .tk-content img:not([class*="emo"])
402
401
  # 使用waline评论可以写: #waline_container .vcontent img
403
- selector: .fancybox img # 多个选择器用英文逗号隔开
402
+ selector: # 多个选择器用英文逗号隔开
404
403
 
405
404
  # swiper
406
405
  swiper:
@@ -420,7 +419,7 @@ plugins:
420
419
  # 需在Markdown文件开头加入mathjax: true
421
420
  # 推荐使用Pandoc: npm uninstall hexo-renderer-marked --save & npm install hexo-renderer-pandoc --save
422
421
  mathjax:
423
- # set <mathjax: true> to enable in page's front-matter
422
+ enable: # true # 可以在特定文章的 front-matter 中设置 mathjax: true 来开启,也可以在这里设置全局开启
424
423
  js: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.6/MathJax.js?config=TeX-AMS-MML_HTMLorMML
425
424
 
426
425
  # Katex - The fastest math typesetting library for the web
@@ -428,7 +427,7 @@ plugins:
428
427
  # https://github.com/KaTeX/KaTeX
429
428
  # 使用 hexo-renderer-markdown-it-plus 作为公式渲染器:npm uninstall hexo-renderer-marked --save npm install hexo-renderer-markdown-it-plus --save
430
429
  katex:
431
- # set <katex: true> to enable in page's front-matter
430
+ enable: # true # 可以在特定文章的 front-matter 中设置 katex: true 来开启,也可以在这里设置全局开启
432
431
  min_css: <link rel="stylesheet" href="https://gcore.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.css" integrity="sha384-vKruj+a13U8yHIkAyGgK1J3ArTLzrFGBbBc0tDp4ad/EyewESeXE/Iv67Aj8gKZ0" crossorigin="anonymous">
433
432
  min_js: <script defer src="https://gcore.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.js" integrity="sha384-PwRUT/YqbnEjkZO0zZxNqcxACrXe+j766U2amXcgMg5457rve2Y7I6ZJSm2A0mS4" crossorigin="anonymous"></script>
434
433
  auto_render_min_js: <script defer src="https://gcore.jsdelivr.net/npm/katex@0.16.4/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"onload="renderMathInElement(document.body);"></script>
@@ -443,7 +442,7 @@ plugins:
443
442
  # B -->|option 2| C(Section C)
444
443
  # ```
445
444
  mermaid:
446
- # set <mermaid: true> to enable in page's front-matter
445
+ enable: # true # 可以在特定文章的 front-matter 中设置 mermaid: true 来开启,也可以在这里设置全局开启
447
446
  style_optimization: false # use custom style in stellar
448
447
  # js: https://unpkg.com/mermaid@9.0.0/dist/mermaid.min.js
449
448
  js: https://cdn.jsdelivr.net/npm/mermaid@v9/dist/mermaid.min.js
@@ -505,7 +504,7 @@ style:
505
504
  background: https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.12/avatar/round/rainbow64@3x.webp
506
505
  codeblock:
507
506
  scrollbar: 4px
508
- highlightjs_theme: https://gcore.jsdelivr.net/gh/highlightjs/cdn-release@11.7.0/build/styles/atom-one-dark.min.css
507
+ highlightjs_theme: https://gcore.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/atom-one-dark.min.css
509
508
  loading:
510
509
  loading: 正在加载
511
510
  error: 加载失败,请稍后重试。
@@ -516,8 +515,8 @@ style:
516
515
  # 可以设置:纯色/渐变色/图片作为背景
517
516
  # background: 'linear-gradient(to bottom, #abc3, #abc3)'
518
517
  # background: 'linear-gradient(to bottom, #20E2D744, #F9FEA544)'
519
- # 在图片上层增加高斯模糊效果(同时附带饱和度增强效果)
520
518
  background: 'url(https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.13/image/sidebar-bg1@small.jpg)'
519
+ # 在图片上层增加高斯模糊效果(同时附带饱和度增强效果)
521
520
  blur: true
522
521
  paginator:
523
522
  prev: https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.12/arrow/f049bbd4e88ec.svg
@@ -1,3 +1,3 @@
1
- <% if (page.katex == true) { %>
1
+ <% if (page.katex == true || theme.plugins.katex.enable == true) { %>
2
2
  <%- partial('katex/head') %>
3
3
  <% } %>
@@ -1,9 +1,9 @@
1
- <% if (page.katex == true) { %>
1
+ <% if (page.katex == true || theme.plugins.katex.enable) { %>
2
2
  <%- partial('katex/script') %>
3
3
  <% } %>
4
- <% if (page.mathjax == true) { %>
4
+ <% if (page.mathjax == true || theme.plugins.mathjax.enable) { %>
5
5
  <%- partial('mathjax/script') %>
6
6
  <% } %>
7
- <% if (page.mermaid == true) { %>
7
+ <% if (page.mermaid == true || theme.plugins.mermaid.enable) { %>
8
8
  <%- partial('mermaid/script') %>
9
9
  <% } %>
@@ -14,18 +14,6 @@ if (page.logo) {
14
14
  subtitle: proj.subtitle
15
15
  }
16
16
  }
17
- } else if (theme.topic.tree[page.topic]) {
18
- const topic = theme.topic.tree[page.topic]
19
- var l = topic.logo
20
- if (l) {
21
- logo = l
22
- } else if (topic.name || topic.icon) {
23
- logo = {
24
- icon: topic.icon || theme.default.topic,
25
- title: `[${topic.name || topic.title}](${url_for(topic.homepage?.path || '')})`,
26
- subtitle: topic.subtitle
27
- }
28
- }
29
17
  }
30
18
 
31
19
  // logo.icon, logo.title, logo.subtitle, logo.url
@@ -2,7 +2,7 @@
2
2
  function layoutDiv() {
3
3
  var el = ''
4
4
  el += `<nav class="menu dis-select${where == 'main' ? ' mobile-hidden' : ''}">`
5
- for (let item of theme.menubar.items) {
5
+ for (let item of (theme.menubar.items || [])) {
6
6
  if (item == undefined || item.id == null || item.url == null) {
7
7
  continue
8
8
  }
@@ -2,6 +2,11 @@
2
2
  if (item.filter == null) {
3
3
  item.filter = 'auto'
4
4
  }
5
+ if (item.placeholder == null && item.filter == 'auto') {
6
+ if (theme.wiki.tree[page.wiki]?.name) {
7
+ item.placeholder = __('search.search_in', theme.wiki.tree[page.wiki]?.name)
8
+ }
9
+ }
5
10
  function layoutDiv() {
6
11
  var el = ''
7
12
  el += `<div class="search-wrapper" id="search-wrapper">`
@@ -25,7 +25,8 @@ function layoutDiv() {
25
25
  arr = site.posts.filter( p => p.title && p.title.length > 0)
26
26
  arr = arr.sort("updated", -1)
27
27
  }
28
- el += '<div class="widget-body fs14">';
28
+ el += '<div class="widget-body fs14">'
29
+ arr = arr.filter(p => p.title?.length > 0)
29
30
  arr.length = item.limit
30
31
  arr.forEach(post => {
31
32
  if (!post) { return }
@@ -39,7 +40,7 @@ function layoutDiv() {
39
40
  el += '<strong>' + name + '</strong>' + '<span class="dot"></span>';
40
41
  }
41
42
  }
42
- el += (post.title || post.wiki) + '</span>';
43
+ el += post.title + '</span>';
43
44
  if (isActive) {
44
45
  el += icon('default:bookmark.active')
45
46
  }
@@ -17,7 +17,8 @@ function layoutArchiveList() {
17
17
  }
18
18
  el += `<div class="post-list archives">`
19
19
  var years = []
20
- site.posts.sort('date', -1).each(function(post) {
20
+ const posts = page.author != null ? site.posts.filter(p => (p.author || theme.default_author.name) == page.author.name) : site.posts
21
+ posts.sort('date', -1).each(function(post) {
21
22
  post.year = date(post.date, 'YYYY')
22
23
  if (post.year && (years.includes(post.year) == false) && (post.title || post.date)) {
23
24
  years.push(post.year)
@@ -26,7 +27,7 @@ function layoutArchiveList() {
26
27
  for (let year of years) {
27
28
  el += `<article class="${scrollreveal('')}" id="archive">`
28
29
  el += `<div class='archive-header h4'>${year}</div>`
29
- site.posts.sort('date', -1).filter(function (post) {
30
+ posts.sort('date', -1).filter(function (post) {
30
31
  post.year = date(post.date, 'YYYY')
31
32
  return post.year == year
32
33
  }).each(function(post) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-stellar",
3
- "version": "1.26.0",
3
+ "version": "1.26.2",
4
4
  "description": "Elegant and powerful theme for Hexo.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -21,6 +21,9 @@ function getWikiObject(ctx) {
21
21
  const data = ctx.locals.get('data')
22
22
  var list = []
23
23
  for (let key of Object.keys(data)) {
24
+ if (key.endsWith('.DS_Store')) {
25
+ continue
26
+ }
24
27
  if (key.includes('wiki/') && key.length > 5) {
25
28
  let newKey = key.replace('wiki/', '')
26
29
  let obj = data[key]
@@ -15,9 +15,11 @@
15
15
 
16
16
  'use strict'
17
17
 
18
+ var index = 0
19
+
18
20
  function img(src, alt) {
19
21
  let img = ''
20
- img += `<img src="${src}"`
22
+ img += `<img data-fancybox="gallery-${index}" src="${src}"`
21
23
  if (alt?.length > 0) {
22
24
  img += ` alt="${alt}"`
23
25
  }
@@ -44,7 +46,8 @@ module.exports = ctx => function(args, content) {
44
46
  if (args.layout == 'flow') {
45
47
  layoutType = 'flow'
46
48
  }
47
- el += `<div class="tag-plugin gallery fancybox ${layoutType}-box" ${ctx.args.joinTags(args, ['size', 'ratio']).join(' ')}>`
49
+ index += 1
50
+ el += `<div class="tag-plugin gallery ${layoutType}-box" ${ctx.args.joinTags(args, ['size', 'ratio']).join(' ')}>`
48
51
  const img_mds = content.split('\n').filter(item => item.trim().length > 0)
49
52
  for (let md of img_mds) {
50
53
  const matches = md.match(/\!\[(.*?)\]\((.*?)\)/i)
@@ -25,10 +25,10 @@ module.exports = ctx => function(args) {
25
25
  }
26
26
  // 覆盖配置
27
27
  if (args.fancybox && args.fancybox.length > 0) {
28
- if (args.fancybox == 'true') {
29
- fancybox = true
30
- } else if (args.fancybox == 'false') {
28
+ if (args.fancybox == 'false') {
31
29
  fancybox = false
30
+ } else {
31
+ fancybox = args.fancybox
32
32
  }
33
33
  }
34
34
  }
@@ -40,7 +40,7 @@ module.exports = ctx => function(args) {
40
40
  img += ' alt="' + alt + '"'
41
41
  }
42
42
  if (fancybox) {
43
- img += ' fancybox="true"'
43
+ img += ` data-fancybox="${fancybox}"`
44
44
  }
45
45
  if (style.length > 0) {
46
46
  img += ' style="' + style + '"'
@@ -6,4 +6,4 @@ svg.icon
6
6
  overflow: hidden
7
7
 
8
8
  svg.active-icon
9
- color: $c-green
9
+ color: $color-theme
@@ -32,5 +32,9 @@
32
32
  background: none
33
33
  padding: 0
34
34
  margin: 0
35
+ .highlight, pre:not([class]):has(>code)
36
+ background: var(--alpha50)
37
+
35
38
 
36
-
39
+ .tag-plugin.timeline[api] .body .footer
40
+ background: none
@@ -55,7 +55,8 @@
55
55
  border-bottom-left-radius: $border-card
56
56
  border-bottom-right-radius: $border-card
57
57
  a.toc-link:before
58
- left: -2px
58
+ left: -7px
59
59
  width: 4px
60
+ background: var(--text-p2)
60
61
  a.toc-link:hover
61
62
  background: var(--alpha100)
@@ -1,6 +1,2 @@
1
- img[fancybox='true']
1
+ img[data-fancybox]
2
2
  cursor: zoom-in
3
-
4
- .fancybox
5
- img
6
- cursor: zoom-in
@@ -1,31 +1,16 @@
1
- trans-cover($p, $t = 0.28s)
2
- trans2pro: transform 0.5s $p $t
3
- trans-site($p)
4
- trans2: box-shadow transform $p
5
- trans-user($p)
6
- trans3: box-shadow transform $p
7
-
8
- if hexo-config('plugins.lazyload.transition') == 'blur'
9
- img.lazy
10
- trans-cover filter
1
+ img.lazy
2
+ &:not(.loaded)
3
+ opacity: 0
4
+ &.loaded,&.error
5
+ opacity: 1
6
+ if hexo-config('plugins.lazyload.transition') == 'blur'
7
+ trans1 all 0.75s
11
8
  &:not(.loaded)
12
- filter blur(8px)
13
- -webkit-filter blur(8px)
9
+ filter blur(50px)
10
+ -webkit-filter blur(50px)
14
11
  &.loaded,&.error
15
12
  filter none
16
13
  -webkit-filter none
17
- .site-card .card-link>img
18
- trans-site filter
19
- .user-card .card-link>img
20
- trans-user filter
21
- else
22
- img.lazy
23
- trans-cover opacity 0.5s
24
- &:not(.loaded)
25
- opacity: 0
26
- &.loaded,&.error
27
- opacity: 1
28
- .site-card .card-link>img
29
- trans-site opacity
30
- .user-card .card-link>img
31
- trans-user opacity
14
+ else
15
+ trans1 all 0.38s
16
+
package/source/js/main.js CHANGED
@@ -286,13 +286,7 @@ if (stellar.plugins.swiper) {
286
286
 
287
287
  // preload
288
288
  if (stellar.plugins.preload) {
289
- if (stellar.plugins.preload.service == 'instant_page') {
290
- stellar.loadScript(stellar.plugins.preload.instant_page, {
291
- defer: true,
292
- type: 'module',
293
- integrity: 'sha384-OeDn4XE77tdHo8pGtE1apMPmAipjoxUQ++eeJa6EtJCfHlvijigWiJpD7VDPWXV1'
294
- })
295
- } else if (stellar.plugins.preload.service == 'flying_pages') {
289
+ if (stellar.plugins.preload.service == 'flying_pages') {
296
290
  window.FPConfig = {
297
291
  delay: 0,
298
292
  ignoreKeywords: [],
@@ -303,24 +297,9 @@ if (stellar.plugins.preload) {
303
297
  }
304
298
  }
305
299
 
306
- function loadFancybox() {
307
- stellar.loadCSS(stellar.plugins.fancybox.css);
308
- stellar.loadScript(stellar.plugins.fancybox.js, { defer: true }).then(function () {
309
- Fancybox.bind(selector, {
310
- groupAll: true,
311
- hideScrollbar: false,
312
- Thumbs: {
313
- autoStart: false,
314
- },
315
- caption: function (fancybox, carousel, slide) {
316
- return slide.$trigger.alt || null
317
- }
318
- });
319
- })
320
- }
321
300
  // fancybox
322
301
  if (stellar.plugins.fancybox) {
323
- let selector = 'img[fancybox]:not(.error)';
302
+ let selector = '[data-fancybox]:not(.error)';
324
303
  if (stellar.plugins.fancybox.selector) {
325
304
  selector += `, ${stellar.plugins.fancybox.selector}`
326
305
  }
@@ -335,13 +314,12 @@ if (stellar.plugins.fancybox) {
335
314
  stellar.loadCSS(stellar.plugins.fancybox.css);
336
315
  stellar.loadScript(stellar.plugins.fancybox.js, { defer: true }).then(function () {
337
316
  Fancybox.bind(selector, {
338
- groupAll: true,
339
317
  hideScrollbar: false,
340
318
  Thumbs: {
341
319
  autoStart: false,
342
320
  },
343
- caption: function (fancybox, carousel, slide) {
344
- return slide.$trigger.alt || null
321
+ caption: (fancybox, slide) => {
322
+ return slide.triggerEl.alt || null
345
323
  }
346
324
  });
347
325
  })
@@ -91,11 +91,10 @@ const MemosJS = {
91
91
  cell += '<div class="tag-plugin image">';
92
92
  for (let img of imgs) {
93
93
  if (img.externalLink?.length > 0) {
94
- cell += `<div class="image-bg"><img src="${img.externalLink}" fancybox="true"></div>`;
94
+ cell += `<div class="image-bg"><img src="${img.externalLink}" data-fancybox="memos"></div>`;
95
95
  } else {
96
- cell += `<div class="image-bg"><img src="https://${cfg.host}/o/r/${img.id}" fancybox="true"></div>`;
96
+ cell += `<div class="image-bg"><img src="https://${cfg.host}/o/r/${img.id}" data-fancybox="memos"></div>`;
97
97
  }
98
-
99
98
  }
100
99
  cell += '</div>';
101
100
  }