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.
- package/_config.yml +1 -1
- package/layout/_plugins/fancybox.ejs +2 -2
- package/package.json +1 -1
- package/scripts/tags/lib/image.js +16 -4
- package/source/css/_common/highlight.styl +4 -2
- package/source/css/_plugins/fancybox.styl +1 -1
- package/source/css/main.styl +1 -1
- package/source/js/plugins/copycode.js +1 -1
- /package/source/css/{_layout → _components}/index.styl +0 -0
- /package/source/css/{_layout → _components}/layout.styl +0 -0
- /package/source/css/{_layout → _components}/list.styl +0 -0
- /package/source/css/{_layout → _components}/main.styl +0 -0
- /package/source/css/{_layout → _components}/md.styl +0 -0
- /package/source/css/{_layout → _components}/pages/archives.styl +0 -0
- /package/source/css/{_layout → _components}/pages/error.styl +0 -0
- /package/source/css/{_layout → _components}/partial/article-banner.styl +0 -0
- /package/source/css/{_layout → _components}/partial/article-footer.styl +0 -0
- /package/source/css/{_layout → _components}/partial/bread-nav.styl +0 -0
- /package/source/css/{_layout → _components}/partial/cover.styl +0 -0
- /package/source/css/{_layout → _components}/partial/footer.styl +0 -0
- /package/source/css/{_layout → _components}/partial/navbar.styl +0 -0
- /package/source/css/{_layout → _components}/partial/paginator.styl +0 -0
- /package/source/css/{_layout → _components}/partial/related.styl +0 -0
- /package/source/css/{_layout → _components}/sidebar/footer.styl +0 -0
- /package/source/css/{_layout → _components}/sidebar/logo.styl +0 -0
- /package/source/css/{_layout → _components}/sidebar/menu.styl +0 -0
- /package/source/css/{_layout → _components}/sidebar/nav-area.styl +0 -0
- /package/source/css/{_layout → _components}/sidebar/search.styl +0 -0
- /package/source/css/{_layout → _components}/sidebar/sidebar.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/about.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/banner.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/button.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/checkbox.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/common.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/copy.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/emoji.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/folders.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/folding.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/frame.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/friends.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/gallery.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/ghcard.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/grid.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/hashtag.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/icon.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/image.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/inline-labels.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/link.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/mark.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/media.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/navbar.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/note.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/okr.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/override.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/poetry.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/quot.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/sites.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/tabs.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/timeline.styl +0 -0
- /package/source/css/{_layout → _components}/tag-plugins/toc.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/components.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/ghrepo.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/ghuser.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/list.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/markdown.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/related.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/tagcloud.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/timeline.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/toc.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/tree.styl +0 -0
- /package/source/css/{_layout → _components}/widgets/widgets.styl +0 -0
package/_config.yml
CHANGED
package/package.json
CHANGED
|
@@ -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:
|
|
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
|
package/source/css/main.styl
CHANGED
|
@@ -7,7 +7,7 @@ window.codeElements.forEach((codeElement) => {
|
|
|
7
7
|
|
|
8
8
|
// 添加点击事件监听
|
|
9
9
|
codeCopyBtn.addEventListener('click', async () => {
|
|
10
|
-
const codeToCopy = codeElement.querySelector('
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|