hexo-theme-stellar 1.28.0 → 1.28.1

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 (71) hide show
  1. package/_config.yml +1 -1
  2. package/layout/_plugins/fancybox.ejs +2 -2
  3. package/package.json +1 -1
  4. package/scripts/tags/lib/image.js +16 -4
  5. package/source/css/_common/highlight.styl +4 -2
  6. package/source/css/_plugins/fancybox.styl +1 -1
  7. package/source/css/main.styl +1 -1
  8. package/source/js/plugins/copycode.js +1 -1
  9. /package/source/css/{_layout → _components}/index.styl +0 -0
  10. /package/source/css/{_layout → _components}/layout.styl +0 -0
  11. /package/source/css/{_layout → _components}/list.styl +0 -0
  12. /package/source/css/{_layout → _components}/main.styl +0 -0
  13. /package/source/css/{_layout → _components}/md.styl +0 -0
  14. /package/source/css/{_layout → _components}/pages/archives.styl +0 -0
  15. /package/source/css/{_layout → _components}/pages/error.styl +0 -0
  16. /package/source/css/{_layout → _components}/partial/article-banner.styl +0 -0
  17. /package/source/css/{_layout → _components}/partial/article-footer.styl +0 -0
  18. /package/source/css/{_layout → _components}/partial/bread-nav.styl +0 -0
  19. /package/source/css/{_layout → _components}/partial/cover.styl +0 -0
  20. /package/source/css/{_layout → _components}/partial/footer.styl +0 -0
  21. /package/source/css/{_layout → _components}/partial/navbar.styl +0 -0
  22. /package/source/css/{_layout → _components}/partial/paginator.styl +0 -0
  23. /package/source/css/{_layout → _components}/partial/related.styl +0 -0
  24. /package/source/css/{_layout → _components}/sidebar/footer.styl +0 -0
  25. /package/source/css/{_layout → _components}/sidebar/logo.styl +0 -0
  26. /package/source/css/{_layout → _components}/sidebar/menu.styl +0 -0
  27. /package/source/css/{_layout → _components}/sidebar/nav-area.styl +0 -0
  28. /package/source/css/{_layout → _components}/sidebar/search.styl +0 -0
  29. /package/source/css/{_layout → _components}/sidebar/sidebar.styl +0 -0
  30. /package/source/css/{_layout → _components}/tag-plugins/about.styl +0 -0
  31. /package/source/css/{_layout → _components}/tag-plugins/banner.styl +0 -0
  32. /package/source/css/{_layout → _components}/tag-plugins/button.styl +0 -0
  33. /package/source/css/{_layout → _components}/tag-plugins/checkbox.styl +0 -0
  34. /package/source/css/{_layout → _components}/tag-plugins/common.styl +0 -0
  35. /package/source/css/{_layout → _components}/tag-plugins/copy.styl +0 -0
  36. /package/source/css/{_layout → _components}/tag-plugins/emoji.styl +0 -0
  37. /package/source/css/{_layout → _components}/tag-plugins/folders.styl +0 -0
  38. /package/source/css/{_layout → _components}/tag-plugins/folding.styl +0 -0
  39. /package/source/css/{_layout → _components}/tag-plugins/frame.styl +0 -0
  40. /package/source/css/{_layout → _components}/tag-plugins/friends.styl +0 -0
  41. /package/source/css/{_layout → _components}/tag-plugins/gallery.styl +0 -0
  42. /package/source/css/{_layout → _components}/tag-plugins/ghcard.styl +0 -0
  43. /package/source/css/{_layout → _components}/tag-plugins/grid.styl +0 -0
  44. /package/source/css/{_layout → _components}/tag-plugins/hashtag.styl +0 -0
  45. /package/source/css/{_layout → _components}/tag-plugins/icon.styl +0 -0
  46. /package/source/css/{_layout → _components}/tag-plugins/image.styl +0 -0
  47. /package/source/css/{_layout → _components}/tag-plugins/inline-labels.styl +0 -0
  48. /package/source/css/{_layout → _components}/tag-plugins/link.styl +0 -0
  49. /package/source/css/{_layout → _components}/tag-plugins/mark.styl +0 -0
  50. /package/source/css/{_layout → _components}/tag-plugins/media.styl +0 -0
  51. /package/source/css/{_layout → _components}/tag-plugins/navbar.styl +0 -0
  52. /package/source/css/{_layout → _components}/tag-plugins/note.styl +0 -0
  53. /package/source/css/{_layout → _components}/tag-plugins/okr.styl +0 -0
  54. /package/source/css/{_layout → _components}/tag-plugins/override.styl +0 -0
  55. /package/source/css/{_layout → _components}/tag-plugins/poetry.styl +0 -0
  56. /package/source/css/{_layout → _components}/tag-plugins/quot.styl +0 -0
  57. /package/source/css/{_layout → _components}/tag-plugins/sites.styl +0 -0
  58. /package/source/css/{_layout → _components}/tag-plugins/tabs.styl +0 -0
  59. /package/source/css/{_layout → _components}/tag-plugins/timeline.styl +0 -0
  60. /package/source/css/{_layout → _components}/tag-plugins/toc.styl +0 -0
  61. /package/source/css/{_layout → _components}/widgets/components.styl +0 -0
  62. /package/source/css/{_layout → _components}/widgets/ghrepo.styl +0 -0
  63. /package/source/css/{_layout → _components}/widgets/ghuser.styl +0 -0
  64. /package/source/css/{_layout → _components}/widgets/list.styl +0 -0
  65. /package/source/css/{_layout → _components}/widgets/markdown.styl +0 -0
  66. /package/source/css/{_layout → _components}/widgets/related.styl +0 -0
  67. /package/source/css/{_layout → _components}/widgets/tagcloud.styl +0 -0
  68. /package/source/css/{_layout → _components}/widgets/timeline.styl +0 -0
  69. /package/source/css/{_layout → _components}/widgets/toc.styl +0 -0
  70. /package/source/css/{_layout → _components}/widgets/tree.styl +0 -0
  71. /package/source/css/{_layout → _components}/widgets/widgets.styl +0 -0
package/_config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  ######## Stellar info ########
2
2
  stellar:
3
- version: '1.28.0'
3
+ version: '1.28.1'
4
4
  homepage: 'https://xaoxuu.com/wiki/stellar/'
5
5
  repo: 'https://github.com/xaoxuu/hexo-theme-stellar'
6
6
  main_css: /css/main.css
@@ -24,9 +24,9 @@
24
24
  autoStart: false,
25
25
  },
26
26
  caption: (fancybox, slide) => {
27
- return slide.triggerEl.alt || null
27
+ return slide.triggerEl.alt || slide.triggerEl.dataset.caption || null
28
28
  }
29
29
  });
30
30
  })
31
31
  }
32
- </script>
32
+ </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-stellar",
3
- "version": "1.28.0",
3
+ "version": "1.28.1",
4
4
  "description": "Elegant and powerful theme for Hexo.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -2,7 +2,7 @@
2
2
  * image.js v1 | https://github.com/xaoxuu/hexo-theme-stellar/
3
3
  * 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
4
4
  *
5
- * {% image src [alt] [width:400px] [bg:#eee] [download:true/false/url] %}
5
+ * {% image src [alt] [width:400px] [bg:#eee] [download:true/false/url] [fancybox:true/false/url] %}
6
6
  */
7
7
 
8
8
  'use strict'
@@ -18,6 +18,7 @@ module.exports = ctx => function(args) {
18
18
  }
19
19
  // fancybox
20
20
  var fancybox = false
21
+ var fancyboxHref = null
21
22
  if (ctx.theme.config.plugins.fancybox && ctx.theme.config.plugins.fancybox.enable) {
22
23
  // 主题配置
23
24
  if (ctx.theme.config.tag_plugins.image && ctx.theme.config.tag_plugins.image.fancybox) {
@@ -27,8 +28,11 @@ module.exports = ctx => function(args) {
27
28
  if (args.fancybox && args.fancybox.length > 0) {
28
29
  if (args.fancybox == 'false') {
29
30
  fancybox = false
30
- } else {
31
+ } else if (args.fancybox === 'true') {
31
32
  fancybox = args.fancybox
33
+ } else {
34
+ fancybox = true
35
+ fancyboxHref = args.fancybox
32
36
  }
33
37
  }
34
38
  }
@@ -36,16 +40,24 @@ module.exports = ctx => function(args) {
36
40
  function img(src, alt, style) {
37
41
  let img = ''
38
42
  img += '<img src="' + src + '"'
43
+ let a = '<a data-fancybox'
39
44
  if (alt) {
40
45
  img += ' alt="' + alt + '"'
46
+ a += ` data-caption="${alt}"`
41
47
  }
42
- if (fancybox) {
48
+ if (fancybox && !fancyboxHref) {
43
49
  img += ` data-fancybox="${fancybox}"`
44
50
  }
45
51
  if (style.length > 0) {
46
52
  img += ' style="' + style + '"'
47
53
  }
48
54
  img += '/>'
55
+
56
+ if (fancyboxHref) {
57
+ a += ` href="${fancyboxHref}">${img}</a>`
58
+ return a
59
+ }
60
+
49
61
  return img
50
62
  }
51
63
 
@@ -87,4 +99,4 @@ module.exports = ctx => function(args) {
87
99
 
88
100
  el += '</div>'
89
101
  return el
90
- }
102
+ }
@@ -75,7 +75,6 @@ p>code:not([class]),li>code:not([class])
75
75
  padding-left: 0.25em
76
76
 
77
77
  .md-text .gist
78
- --fgColor-default: var(--text-p1)
79
78
  .gist-file
80
79
  border: 1px solid var(--block-border)
81
80
  border-radius: $border-card
@@ -86,9 +85,12 @@ p>code:not([class]),li>code:not([class])
86
85
  display: inherit
87
86
  border: none
88
87
  border-radius: 0
89
- background: none
88
+ background: var(--block)
90
89
  margin: 0
91
90
  padding: 1em 0
91
+ .blob-code-inner
92
+ color: var(--text-p1)
93
+ font-family: $ff-codeblock
92
94
  .gist-meta
93
95
  background: var(--block-border)
94
96
 
@@ -1,2 +1,2 @@
1
- img[data-fancybox]
1
+ img[data-fancybox], a[data-fancybox]
2
2
  cursor: zoom-in
@@ -11,7 +11,7 @@
11
11
  // 通用组件
12
12
  @import '_common/*'
13
13
  // 布局
14
- @import '_layout/*'
14
+ @import '_components/*'
15
15
 
16
16
  // 可选插件
17
17
  @import '_plugins/index'
@@ -7,7 +7,7 @@ window.codeElements.forEach((codeElement) => {
7
7
 
8
8
  // 添加点击事件监听
9
9
  codeCopyBtn.addEventListener('click', async () => {
10
- const codeToCopy = codeElement.querySelector('code')?.textContent || '';
10
+ const codeToCopy = codeElement.querySelector('pre')?.innerText || '';
11
11
  if (navigator.clipboard) {
12
12
  try {
13
13
  await navigator.clipboard.writeText(codeToCopy);
File without changes
File without changes
File without changes
File without changes
File without changes