hexo-theme-stellar 1.26.8 → 1.28.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.
- package/_config.yml +139 -95
- package/_data/icons.yml +8 -1
- package/_data/widgets.yml +19 -7
- package/languages/en.yml +5 -2
- package/languages/zh-CN.yml +4 -1
- package/languages/zh-TW.yml +5 -2
- package/layout/404.ejs +1 -1
- package/layout/_partial/{plugins/comments → comments}/artalk/script.ejs +2 -2
- package/layout/_partial/{plugins/comments/utterances → comments/giscus}/layout.ejs +5 -2
- package/layout/_partial/{plugins/comments → comments}/giscus/script.ejs +1 -4
- package/layout/_partial/{plugins/comments → comments}/layout.ejs +14 -9
- package/layout/_partial/{plugins/comments → comments}/twikoo/script.ejs +1 -1
- package/layout/_partial/comments/waline/script.ejs +43 -0
- package/layout/_partial/head.ejs +2 -2
- package/layout/_partial/main/article/article_footer.ejs +1 -1
- package/layout/_partial/main/footer.ejs +1 -1
- package/layout/_partial/main/navbar/article_banner.ejs +81 -17
- package/layout/_partial/main/navbar/ghinfo.ejs +1 -1
- package/layout/_partial/main/post_list/post_card.ejs +1 -1
- package/layout/_partial/menubtn.ejs +6 -3
- package/layout/_partial/scripts/defines.ejs +31 -0
- package/layout/_partial/scripts/services.ejs +29 -0
- package/layout/_partial/scripts/sidebar.ejs +25 -0
- package/layout/_partial/scripts/utils.ejs +158 -0
- package/layout/_partial/scripts.ejs +32 -0
- package/layout/_partial/sidebar/{index.ejs → index_leftbar.ejs} +22 -20
- package/layout/_partial/sidebar/index_rightbar.ejs +84 -0
- package/layout/_partial/sidebar/logo.ejs +1 -1
- package/layout/_partial/widgets/author.ejs +37 -0
- package/layout/_partial/widgets/components/edit.ejs +24 -0
- package/layout/_partial/widgets/ghissues.ejs +1 -1
- package/layout/_partial/widgets/ghrepo.ejs +2 -2
- package/layout/_partial/widgets/ghuser.ejs +2 -2
- package/layout/_partial/widgets/markdown.ejs +1 -1
- package/layout/_partial/widgets/recent.ejs +1 -5
- package/layout/_partial/widgets/related.ejs +1 -1
- package/layout/_partial/widgets/timeline.ejs +1 -1
- package/layout/_partial/widgets/toc.ejs +38 -85
- package/layout/_partial/widgets/tree.ejs +71 -0
- package/layout/_plugins/copycode.ejs +13 -0
- package/layout/_plugins/fancybox.ejs +32 -0
- package/layout/_plugins/heti.ejs +21 -0
- package/layout/_plugins/index.ejs +24 -0
- package/layout/_plugins/lazyload.ejs +21 -0
- package/layout/{_partial/plugins/parser/mathjax/script.ejs → _plugins/mathjax.ejs} +1 -1
- package/layout/_plugins/mermaid.ejs +29 -0
- package/layout/_plugins/preload.ejs +9 -0
- package/layout/_plugins/scrollreveal.ejs +15 -0
- package/layout/_plugins/search/algolia_search.ejs +13 -0
- package/layout/_plugins/search/local_search.ejs +8 -0
- package/layout/_plugins/swiper.ejs +26 -0
- package/layout/_plugins/tianli_gpt.ejs +14 -0
- package/layout/archive.ejs +9 -2
- package/layout/layout.ejs +9 -6
- package/layout/page.ejs +2 -10
- package/package.json +1 -1
- package/scripts/events/lib/doc_tree.js +8 -8
- package/scripts/events/lib/topic_tree.js +3 -0
- package/scripts/generators/author.js +3 -2
- package/scripts/helpers/parse_config.js +6 -5
- package/scripts/tags/lib/albums.js +2 -2
- package/scripts/tags/lib/button.js +1 -1
- package/scripts/tags/lib/emoji.js +1 -1
- package/scripts/tags/lib/friends.js +1 -1
- package/scripts/tags/lib/icon.js +10 -5
- package/scripts/tags/lib/link.js +2 -2
- package/scripts/tags/lib/md.js +1 -1
- package/scripts/tags/lib/posters.js +2 -2
- package/scripts/tags/lib/sites.js +1 -1
- package/scripts/tags/lib/timeline.js +2 -2
- package/source/css/_common/button.styl +8 -2
- package/source/css/_common/device.styl +39 -12
- package/source/css/_custom.styl +15 -16
- package/source/css/_defines/const.styl +1 -1
- package/source/css/_defines/func.styl +14 -4
- package/source/css/_defines/theme.styl +38 -27
- package/source/css/_layout/layout.styl +62 -27
- package/source/css/_layout/list.styl +1 -1
- package/source/css/_layout/main.styl +1 -4
- package/source/css/_layout/md.styl +16 -2
- package/source/css/_layout/pages/archives.styl +4 -0
- package/source/css/_layout/partial/article-banner.styl +14 -15
- package/source/css/_layout/partial/article-footer.styl +0 -5
- package/source/css/_layout/partial/footer.styl +9 -6
- package/source/css/_layout/partial/related.styl +4 -0
- package/source/css/_layout/sidebar/footer.styl +3 -1
- package/source/css/_layout/sidebar/logo.styl +3 -1
- package/source/css/_layout/sidebar/menu.styl +1 -1
- package/source/css/_layout/sidebar/nav-area.styl +1 -1
- package/source/css/_layout/sidebar/sidebar.styl +25 -16
- package/source/css/_layout/tag-plugins/banner.styl +1 -8
- package/source/css/_layout/tag-plugins/common.styl +10 -5
- package/source/css/_layout/tag-plugins/emoji.styl +1 -0
- package/source/css/_layout/tag-plugins/icon.styl +6 -0
- package/source/css/_layout/tag-plugins/image.styl +1 -1
- package/source/css/_layout/tag-plugins/quot.styl +1 -1
- package/source/css/_layout/tag-plugins/timeline.styl +26 -27
- package/source/css/_layout/widgets/ghrepo.styl +1 -1
- package/source/css/_layout/widgets/ghuser.styl +9 -5
- package/source/css/_layout/widgets/list.styl +4 -3
- package/source/css/_layout/widgets/related.styl +0 -1
- package/source/css/_layout/widgets/timeline.styl +27 -21
- package/source/css/_layout/widgets/toc.styl +182 -0
- package/source/css/_layout/widgets/tree.styl +0 -0
- package/source/css/_layout/widgets/widgets.styl +26 -7
- package/source/css/_plugins/comments/twikoo.styl +103 -59
- package/source/css/_plugins/comments/waline.styl +13 -10
- package/source/css/_plugins/index.styl +2 -0
- package/source/css/_plugins/katex.styl +5 -0
- package/source/css/_plugins/mermaid.styl +49 -59
- package/source/css/_plugins/tianli_gpt.styl +208 -151
- package/source/js/main.js +52 -251
- package/source/js/plugins/copycode.js +28 -41
- package/source/js/search/algolia-search.js +75 -0
- package/source/js/search/local-search.js +32 -0
- package/source/js/services/fcircle.js +36 -0
- package/source/js/services/friends.js +27 -0
- package/source/js/services/ghinfo.js +33 -0
- package/source/js/services/mdrender.js +10 -0
- package/source/js/services/memos.js +73 -0
- package/source/js/services/siteinfo.js +38 -0
- package/source/js/services/sites.js +30 -0
- package/source/js/services/timeline.js +106 -0
- package/source/js/services/weibo.js +60 -0
- package/layout/_partial/main/navbar/article_top_area.ejs +0 -35
- package/layout/_partial/main/navbar/author_banner.ejs +0 -29
- package/layout/_partial/plugins/ai/tianli_gpt.ejs +0 -9
- package/layout/_partial/plugins/comments/waline/script.ejs +0 -39
- package/layout/_partial/plugins/parser/head.ejs +0 -3
- package/layout/_partial/plugins/parser/katex/head.ejs +0 -3
- package/layout/_partial/plugins/parser/katex/script.ejs +0 -4
- package/layout/_partial/plugins/parser/mermaid/script.ejs +0 -29
- package/layout/_partial/plugins/parser/script.ejs +0 -9
- package/layout/_partial/scripts/index.ejs +0 -176
- package/source/css/_layout/widgets/toc_blog.styl +0 -3
- package/source/css/_layout/widgets/toc_common.styl +0 -92
- package/source/css/_layout/widgets/toc_wiki.styl +0 -62
- package/source/js/plugins/fcircle.js +0 -92
- package/source/js/plugins/friends.js +0 -84
- package/source/js/plugins/ghinfo.js +0 -85
- package/source/js/plugins/linkcard.js +0 -48
- package/source/js/plugins/marked.js +0 -50
- package/source/js/plugins/memos.js +0 -132
- package/source/js/plugins/sites.js +0 -87
- package/source/js/plugins/timeline.js +0 -162
- package/source/js/plugins/weibo.js +0 -116
- /package/layout/_partial/{plugins/comments → comments}/artalk/layout.ejs +0 -0
- /package/layout/_partial/{plugins/comments → comments}/beaudar/layout.ejs +0 -0
- /package/layout/_partial/{plugins/comments → comments}/beaudar/script.ejs +0 -0
- /package/layout/_partial/{plugins/comments → comments}/script.ejs +0 -0
- /package/layout/_partial/{plugins/comments → comments}/twikoo/layout.ejs +0 -0
- /package/layout/_partial/{plugins/comments/giscus → comments/utterances}/layout.ejs +0 -0
- /package/layout/_partial/{plugins/comments → comments}/utterances/script.ejs +0 -0
- /package/layout/_partial/{plugins/comments → comments}/waline/layout.ejs +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
window.addEventListener('DOMContentLoaded', (event) => {
|
|
3
|
+
const swiper_api = document.getElementById('swiper-api');
|
|
4
|
+
if (swiper_api != undefined) {
|
|
5
|
+
utils.css(`<%- conf.css %>`);
|
|
6
|
+
utils.js(`<%- conf.js %>`, { defer: true }).then(function () {
|
|
7
|
+
const effect = swiper_api.getAttribute('effect') || '';
|
|
8
|
+
var swiper = new Swiper('.swiper#swiper-api', {
|
|
9
|
+
slidesPerView: 'auto',
|
|
10
|
+
spaceBetween: 8,
|
|
11
|
+
centeredSlides: true,
|
|
12
|
+
effect: effect,
|
|
13
|
+
rewind: true,
|
|
14
|
+
pagination: {
|
|
15
|
+
el: '.swiper-pagination',
|
|
16
|
+
clickable: true,
|
|
17
|
+
},
|
|
18
|
+
navigation: {
|
|
19
|
+
nextEl: '.swiper-button-next',
|
|
20
|
+
prevEl: '.swiper-button-prev',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
</script>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<%
|
|
2
|
+
const { field } = theme.plugins.tianli_gpt;
|
|
3
|
+
const matchesField = field === 'all' || field === layout || (field === 'wiki' && page.wiki) || (field === 'topic' && page.topic);
|
|
4
|
+
if (matchesField) { %>
|
|
5
|
+
<script defer src="<%- theme.plugins.tianli_gpt?.js %>"></script>
|
|
6
|
+
<script defer>
|
|
7
|
+
window.addEventListener('DOMContentLoaded', (event) => {
|
|
8
|
+
new ChucklePostAI(Object.assign({
|
|
9
|
+
el: 'article.content',
|
|
10
|
+
css: `/css/_plugins/tianli_gpt`
|
|
11
|
+
}, JSON.parse(`<%- JSON.stringify(theme.plugins.tianli_gpt) %>`)))
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
<% } %>
|
package/layout/archive.ejs
CHANGED
|
@@ -8,14 +8,21 @@ if (page.author) {
|
|
|
8
8
|
}
|
|
9
9
|
function layoutArchiveList() {
|
|
10
10
|
var el = ''
|
|
11
|
+
var cls = ''
|
|
11
12
|
if (page.author) {
|
|
12
13
|
page.title = page.author.name
|
|
13
|
-
|
|
14
|
+
page.banner = page.author.banner
|
|
15
|
+
page.banner_info = {
|
|
16
|
+
avatar: page.author.avatar,
|
|
17
|
+
subtitle: page.author.description
|
|
18
|
+
}
|
|
19
|
+
el += partial('_partial/main/navbar/article_banner')
|
|
20
|
+
cls += ' author'
|
|
14
21
|
} else {
|
|
15
22
|
page.title = __('btn.archives')
|
|
16
23
|
el += partial('_partial/main/navbar/nav_tabs_blog')
|
|
17
24
|
}
|
|
18
|
-
el += `<div class="post-list archives">`
|
|
25
|
+
el += `<div class="post-list${cls} archives">`
|
|
19
26
|
var years = []
|
|
20
27
|
const posts = page.author != null ? site.posts.filter(p => (p.author || theme.default_author.id) == page.author.id) : site.posts
|
|
21
28
|
posts.sort('date', -1).each(function(post) {
|
package/layout/layout.ejs
CHANGED
|
@@ -42,22 +42,25 @@ html += `<html lang="${page.lang}">`
|
|
|
42
42
|
html += `<body>`
|
|
43
43
|
html += site_background
|
|
44
44
|
html += partial('_partial/cover/index')
|
|
45
|
-
html += `<div class="l_body ${page_type} ${article_type}" id="start" layout="${page.layout}" ${indent ? 'text-indent' : ''}>`
|
|
45
|
+
html += `<div class="l_body s:aa ${page_type} ${article_type}" id="start" layout="${page.layout}" ${indent ? 'text-indent' : ''}>`
|
|
46
46
|
html += `<aside class="l_left">`
|
|
47
|
-
html += `<div class="
|
|
48
|
-
html += partial('_partial/sidebar/
|
|
47
|
+
html += `<div class="leftbar-container${theme.style.leftbar?.blur ? ' leftbar-blur' : ''}">`
|
|
48
|
+
html += partial('_partial/sidebar/index_leftbar')
|
|
49
49
|
html += `</div>`
|
|
50
50
|
html += `</aside>`
|
|
51
51
|
html += `<div class="l_main" id="main">`
|
|
52
52
|
html += partial('_partial/sidebar/logo', {where: 'main'})
|
|
53
53
|
html += body
|
|
54
54
|
html += partial('_partial/main/footer')
|
|
55
|
-
html +=
|
|
56
|
-
html += `<div class="main-mask" onclick="sidebar.toggle()"></div>`
|
|
55
|
+
html += `<div class="main-mask" onclick="sidebar.dismiss()"></div>`
|
|
57
56
|
html += `</div>`
|
|
57
|
+
html += `<aside class="l_right">`
|
|
58
|
+
html += partial('_partial/sidebar/index_rightbar')
|
|
59
|
+
html += `</aside>`
|
|
60
|
+
html += partial('_partial/menubtn')
|
|
58
61
|
html += `</div>`
|
|
59
62
|
html += `<div class="scripts">`
|
|
60
|
-
html += partial('_partial/scripts
|
|
63
|
+
html += partial('_partial/scripts')
|
|
61
64
|
html += `</div>`
|
|
62
65
|
html += `</body>`
|
|
63
66
|
html += `</html>`
|
package/layout/page.ejs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
<%
|
|
2
2
|
const { layout } = page
|
|
3
3
|
// 是否使用 Heti 布局插件
|
|
4
|
-
const isUsingHeti = theme.plugins.heti
|
|
5
|
-
// 是否使用 TianliGPT 插件
|
|
6
|
-
const isUsingTianliGPT = theme.plugins.tianli_gpt.enable && ['all', page.layout].includes(theme.plugins.tianli_gpt.field)
|
|
4
|
+
const isUsingHeti = theme.plugins.heti?.enable
|
|
7
5
|
|
|
8
6
|
// 默认的 menu_id
|
|
9
7
|
if (page.menu_id == null) {
|
|
@@ -27,9 +25,6 @@ function articleClass() {
|
|
|
27
25
|
if (isUsingHeti) {
|
|
28
26
|
str += ' heti'
|
|
29
27
|
}
|
|
30
|
-
if (isUsingTianliGPT) {
|
|
31
|
-
str += ' '
|
|
32
|
-
}
|
|
33
28
|
return str
|
|
34
29
|
}
|
|
35
30
|
|
|
@@ -52,13 +47,10 @@ function layoutDiv() {
|
|
|
52
47
|
if (layout === 'post' || page.wiki) {
|
|
53
48
|
el += partial('_partial/main/article/read_next')
|
|
54
49
|
}
|
|
55
|
-
if (isUsingTianliGPT) {
|
|
56
|
-
el += partial('_partial/plugins/ai/tianli_gpt')
|
|
57
|
-
}
|
|
58
50
|
if (layout === 'post') {
|
|
59
51
|
el += partial('_partial/main/article/related_posts')
|
|
60
52
|
}
|
|
61
|
-
el += partial('_partial/
|
|
53
|
+
el += partial('_partial/comments/layout')
|
|
62
54
|
return el
|
|
63
55
|
}
|
|
64
56
|
%>
|
package/package.json
CHANGED
|
@@ -30,8 +30,8 @@ function getWikiObject(ctx) {
|
|
|
30
30
|
if ((typeof obj.tags == 'string') && obj.tags.constructor == String) {
|
|
31
31
|
obj.tags = [obj.tags]
|
|
32
32
|
}
|
|
33
|
-
if ((typeof obj.
|
|
34
|
-
obj.
|
|
33
|
+
if ((typeof obj.tree == 'object') && obj.tree.constructor == Array) {
|
|
34
|
+
obj.tree = { '': obj.tree }
|
|
35
35
|
}
|
|
36
36
|
obj.id = newKey
|
|
37
37
|
if (obj.sort == null) {
|
|
@@ -108,9 +108,9 @@ module.exports = ctx => {
|
|
|
108
108
|
// 首页
|
|
109
109
|
// 未特别指定首页时,获取TOC第一页作为首页
|
|
110
110
|
var homepage = item.homepage
|
|
111
|
-
if (homepage == null && item.
|
|
112
|
-
for (let id of Object.keys(item.
|
|
113
|
-
const sec = item.
|
|
111
|
+
if (homepage == null && item.tree != null) {
|
|
112
|
+
for (let id of Object.keys(item.tree)) {
|
|
113
|
+
const sec = item.tree[id]
|
|
114
114
|
for (let key of sec) {
|
|
115
115
|
let hs = sub_pages.filter(p => p.path_key == item.base_dir + key)
|
|
116
116
|
if (hs.length > 0) {
|
|
@@ -134,11 +134,11 @@ module.exports = ctx => {
|
|
|
134
134
|
// 内页分组
|
|
135
135
|
var sections = []
|
|
136
136
|
var others = sub_pages
|
|
137
|
-
if (item.
|
|
137
|
+
if (item.tree) {
|
|
138
138
|
// 根据配置设置顺序
|
|
139
|
-
for (let title of Object.keys(item.
|
|
139
|
+
for (let title of Object.keys(item.tree)) {
|
|
140
140
|
var sec = { title: title, pages: []}
|
|
141
|
-
for (let key of item.
|
|
141
|
+
for (let key of item.tree[title]) {
|
|
142
142
|
sec.pages = sec.pages.concat(sub_pages.filter(p => p.path_key == item.base_dir + key))
|
|
143
143
|
others = others.filter(p => p.path_key != item.base_dir + key)
|
|
144
144
|
}
|
|
@@ -13,6 +13,9 @@ function getTopicTree(ctx) {
|
|
|
13
13
|
const data = ctx.locals.get('data')
|
|
14
14
|
var list = []
|
|
15
15
|
for (let key of Object.keys(data)) {
|
|
16
|
+
if (key.endsWith('.DS_Store')) {
|
|
17
|
+
continue
|
|
18
|
+
}
|
|
16
19
|
if (key.startsWith('topic/') && key.length > 5) {
|
|
17
20
|
let newKey = key.replace('topic/', '')
|
|
18
21
|
let obj = data[key]
|
|
@@ -16,8 +16,9 @@ hexo.extend.generator.register('author', function (locals) {
|
|
|
16
16
|
layout: ['archive'],
|
|
17
17
|
data: {
|
|
18
18
|
author: author,
|
|
19
|
-
|
|
20
|
-
menu_id: site_tree.author.menu_id
|
|
19
|
+
leftbar: site_tree.author.leftbar,
|
|
20
|
+
menu_id: site_tree.author.menu_id,
|
|
21
|
+
breadcrumb: false
|
|
21
22
|
}
|
|
22
23
|
})
|
|
23
24
|
}
|
|
@@ -9,17 +9,18 @@ hexo.extend.helper.register('md_text', function(args) {
|
|
|
9
9
|
if (args == undefined) {
|
|
10
10
|
return ''
|
|
11
11
|
}
|
|
12
|
+
const { config } = hexo
|
|
13
|
+
args = args.replace('{config.title}', config.title)
|
|
14
|
+
args = args.replace('{config.subtitle}', config.subtitle)
|
|
15
|
+
args = args.replace('{config.avatar}', config.avatar)
|
|
12
16
|
let tmp = args.split('](')
|
|
13
17
|
if (tmp.length > 1) {
|
|
14
18
|
tmp = tmp[0]
|
|
15
19
|
if (tmp.length > 1) {
|
|
16
20
|
tmp = tmp.substring(1, tmp.length)
|
|
17
21
|
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
tmp = hexo.config.title
|
|
21
|
-
} else if (tmp == 'config.avatar' || tmp == '${config.avatar}') {
|
|
22
|
-
tmp = hexo.config.avatar
|
|
22
|
+
} else {
|
|
23
|
+
tmp = args
|
|
23
24
|
}
|
|
24
25
|
return tmp
|
|
25
26
|
})
|
|
@@ -22,7 +22,7 @@ module.exports = ctx => function(args) {
|
|
|
22
22
|
var el = ''
|
|
23
23
|
el += `<div class="tag-plugin albums-wrap">`
|
|
24
24
|
if (api) {
|
|
25
|
-
el += `<div class="
|
|
25
|
+
el += `<div class="ds-friends" api="${api}"><div class="tag-plugin gallery grid-box" layout="grid" ratio="square" ${ctx.args.joinTags(args, ['size']).join(' ')}></div></div>`
|
|
26
26
|
} else if (args.group) {
|
|
27
27
|
const links = ctx.theme.config.links || {}
|
|
28
28
|
el += `<div class="tag-plugin gallery grid-box" layout="grid" ratio="square" ${ctx.args.joinTags(args, ['size']).join(' ')}>`
|
|
@@ -30,7 +30,7 @@ module.exports = ctx => function(args) {
|
|
|
30
30
|
if (item?.url) {
|
|
31
31
|
el += `<div class="grid-cell album-card">`
|
|
32
32
|
el += `<a class="card-link" target="_blank" rel="external nofollow noopener noreferrer" href="${item.url}">`
|
|
33
|
-
el += `<img src="${item.icon || item.avatar || ctx.theme.config.default.cover}" onerror="javascript:this.removeAttribute("data-src");this.src="${ctx.theme.config.default.cover}";"/>`
|
|
33
|
+
el += `<img src="${item.cover || item.icon || item.avatar || ctx.theme.config.default.cover}" onerror="javascript:this.removeAttribute("data-src");this.src="${ctx.theme.config.default.cover}";"/>`
|
|
34
34
|
el += `<div class="image-meta">`
|
|
35
35
|
if (item.title) {
|
|
36
36
|
el += `<span class="image-caption">${item.title}</span>`
|
|
@@ -22,7 +22,7 @@ module.exports = ctx => function(args) {
|
|
|
22
22
|
args.text = `${args.text} ${arr.join(' ')}`
|
|
23
23
|
}
|
|
24
24
|
if (args.color == null) {
|
|
25
|
-
args.color =
|
|
25
|
+
args.color = ctx.theme.config.tag_plugins.button.default_color
|
|
26
26
|
}
|
|
27
27
|
var el = ''
|
|
28
28
|
el += '<a class="tag-plugin colorful button"'
|
|
@@ -27,7 +27,7 @@ module.exports = ctx => function(args) {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
if (config[args.source] && args.name) {
|
|
30
|
-
let url = config[args.source].replace('
|
|
30
|
+
let url = config[args.source].replace('{name}', args.name)
|
|
31
31
|
el += '<img no-lazy="" class="inline"'
|
|
32
32
|
el += ' src="' + url + '"'
|
|
33
33
|
if (args.height) {
|
|
@@ -18,7 +18,7 @@ module.exports = ctx => function(args) {
|
|
|
18
18
|
|
|
19
19
|
var el = '<div class="tag-plugin users-wrap">'
|
|
20
20
|
if (api) {
|
|
21
|
-
el += `<div class="
|
|
21
|
+
el += `<div class="ds-friends" ${ctx.args.joinTags(args, ['size']).join(' ')} api="${api}"><div class="grid-box"></div></div>`
|
|
22
22
|
} else if (args.group) {
|
|
23
23
|
const links = ctx.theme.config.links || {}
|
|
24
24
|
el += '<div class="grid-box">'
|
package/scripts/tags/lib/icon.js
CHANGED
|
@@ -9,19 +9,24 @@
|
|
|
9
9
|
'use strict'
|
|
10
10
|
|
|
11
11
|
module.exports = ctx => function(args) {
|
|
12
|
-
args = ctx.args.map(args, ['color', 'style'], ['key'])
|
|
12
|
+
args = ctx.args.map(args, ['color', 'style'], ['key', 'text'])
|
|
13
13
|
if (args.color == null) {
|
|
14
14
|
args.color = ctx.theme.config.tag_plugins.icon.default_color
|
|
15
15
|
}
|
|
16
16
|
var el = ''
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
if (args.text) {
|
|
18
|
+
el += `<div class="tag-plugin icon-wrap">`
|
|
19
|
+
}
|
|
20
|
+
el += `<span class="tag-plugin icon colorful" ${ctx.args.joinTags(args, ['color']).join(' ')}>`
|
|
20
21
|
var more = ''
|
|
21
22
|
if (args.style) {
|
|
22
23
|
more += `style="${args.style}"`
|
|
23
24
|
}
|
|
24
25
|
el += ctx.utils.icon(args.key, more)
|
|
25
|
-
el +=
|
|
26
|
+
el += `</span>`
|
|
27
|
+
if (args.text) {
|
|
28
|
+
el += `<span class="text">${args.text}</span>`
|
|
29
|
+
el += '</div>'
|
|
30
|
+
}
|
|
26
31
|
return el
|
|
27
32
|
}
|
package/scripts/tags/lib/link.js
CHANGED
|
@@ -14,9 +14,9 @@ module.exports = ctx => function(args) {
|
|
|
14
14
|
return '';
|
|
15
15
|
}
|
|
16
16
|
const url = full_url_for(args.url)
|
|
17
|
-
args.api = ctx.theme.config.
|
|
17
|
+
args.api = ctx.theme.config.data_services.siteinfo?.api
|
|
18
18
|
if (args.api) {
|
|
19
|
-
args.api = args.api.replace('
|
|
19
|
+
args.api = args.api.replace('{href}', url)
|
|
20
20
|
}
|
|
21
21
|
var autofill = []
|
|
22
22
|
if (!args.title) {
|
package/scripts/tags/lib/md.js
CHANGED
|
@@ -15,6 +15,6 @@ module.exports = ctx => function(args) {
|
|
|
15
15
|
args = ctx.args.map(args, [''], ['src'])
|
|
16
16
|
const md_id = "md_" + ++md_index
|
|
17
17
|
return `
|
|
18
|
-
<div class="
|
|
18
|
+
<div class="ds-mdrender" src="${args.src}" id="${md_id}"></div>
|
|
19
19
|
`
|
|
20
20
|
}
|
|
@@ -22,7 +22,7 @@ module.exports = ctx => function(args) {
|
|
|
22
22
|
var el = ''
|
|
23
23
|
el += `<div class="tag-plugin posters-wrap">`
|
|
24
24
|
if (api) {
|
|
25
|
-
el += `<div class="
|
|
25
|
+
el += `<div class="ds-friends" api="${api}"><div class="tag-plugin gallery grid-box" layout="grid" ratio="square" ${ctx.args.joinTags(args, ['size']).join(' ')}></div></div>`
|
|
26
26
|
} else if (args.group) {
|
|
27
27
|
const links = ctx.theme.config.links || {}
|
|
28
28
|
el += `<div class="tag-plugin gallery grid-box" layout="grid" ratio="portrait" ${ctx.args.joinTags(args, ['size']).join(' ')}>`
|
|
@@ -30,7 +30,7 @@ module.exports = ctx => function(args) {
|
|
|
30
30
|
if (item?.url) {
|
|
31
31
|
el += `<div class="grid-cell poster-card">`
|
|
32
32
|
el += `<a class="card-link" target="_blank" rel="external nofollow noopener noreferrer" href="${item.url}">`
|
|
33
|
-
el += `<img src="${item.icon || item.avatar || ctx.theme.config.default.cover}" onerror="javascript:this.removeAttribute("data-src");this.src="${ctx.theme.config.default.cover}";"/>`
|
|
33
|
+
el += `<img src="${item.cover || item.icon || item.avatar || ctx.theme.config.default.cover}" onerror="javascript:this.removeAttribute("data-src");this.src="${ctx.theme.config.default.cover}";"/>`
|
|
34
34
|
el += `<div class="image-meta">`
|
|
35
35
|
if (item.title) {
|
|
36
36
|
el += `<span class="image-caption">${item.title}</span>`
|
|
@@ -18,7 +18,7 @@ module.exports = ctx => function(args) {
|
|
|
18
18
|
|
|
19
19
|
var el = '<div class="tag-plugin sites-wrap">'
|
|
20
20
|
if (api) {
|
|
21
|
-
el += '<div class="
|
|
21
|
+
el += '<div class="ds-sites"'
|
|
22
22
|
el += ' api="' + api + '"'
|
|
23
23
|
el += '>'
|
|
24
24
|
el += '<div class="grid-box"></div>'
|
|
@@ -18,7 +18,7 @@ function layoutNodeTitle(ctx, content) {
|
|
|
18
18
|
var el = ''
|
|
19
19
|
el += '<div class="header">'
|
|
20
20
|
if (content && content.length > 0) {
|
|
21
|
-
el +=
|
|
21
|
+
el += content
|
|
22
22
|
}
|
|
23
23
|
el += '</div>'
|
|
24
24
|
return el
|
|
@@ -41,7 +41,7 @@ module.exports = ctx => function(args, content = '') {
|
|
|
41
41
|
args.type = 'timeline'
|
|
42
42
|
}
|
|
43
43
|
if (args.api && args.api.length > 0) {
|
|
44
|
-
el +=
|
|
44
|
+
el += `<div class="tag-plugin timeline ds-${args.type}"`
|
|
45
45
|
el += ' ' + ctx.args.joinTags(args, ['api', 'user', 'limit', 'hide', 'avatar']).join(' ')
|
|
46
46
|
el += '>'
|
|
47
47
|
} else {
|
|
@@ -27,7 +27,7 @@ a[onclick]:hover
|
|
|
27
27
|
|
|
28
28
|
a.button.start.gradient
|
|
29
29
|
position relative
|
|
30
|
-
|
|
30
|
+
ondark()
|
|
31
31
|
transition: 0.38s ease-out
|
|
32
32
|
z-index: 0
|
|
33
33
|
background: convert(hexo-config('style.gradient.start'))
|
|
@@ -58,4 +58,10 @@ a.button.start.gradient
|
|
|
58
58
|
transition: 0.38s ease-out
|
|
59
59
|
&:hover:after
|
|
60
60
|
filter: blur(36px)
|
|
61
|
-
opacity 1
|
|
61
|
+
opacity 1
|
|
62
|
+
|
|
63
|
+
if theme(dark)
|
|
64
|
+
ondark()
|
|
65
|
+
else if theme(auto)
|
|
66
|
+
@media (prefers-color-scheme: dark)
|
|
67
|
+
ondark()
|
|
@@ -9,25 +9,32 @@
|
|
|
9
9
|
|
|
10
10
|
.float-panel
|
|
11
11
|
position: sticky
|
|
12
|
+
grid-column-end: span 3
|
|
12
13
|
right: 0
|
|
13
14
|
bottom: 2rem
|
|
14
15
|
float: right
|
|
15
16
|
z-index: 10
|
|
16
17
|
display: flex
|
|
17
|
-
|
|
18
|
+
flex-direction: column
|
|
19
|
+
border-radius: $border-bar
|
|
20
|
+
margin-left: auto
|
|
18
21
|
margin-right: 1rem
|
|
22
|
+
@media screen and (min-width: $device-mobile-max)
|
|
23
|
+
margin-right: 2rem
|
|
19
24
|
overflow: hidden
|
|
20
25
|
--blur-px: 16px
|
|
21
26
|
--blur-bg: alpha(#fff, .4)
|
|
22
27
|
trans1: all
|
|
23
|
-
|
|
24
|
-
@media (prefers-color-scheme: dark)
|
|
25
|
-
--blur-bg: alpha(#000, .4)
|
|
26
|
-
if hexo-config('style.darkmode') == 'always'
|
|
28
|
+
ondark()
|
|
27
29
|
--blur-bg: alpha(#000, .4)
|
|
30
|
+
if theme(dark)
|
|
31
|
+
ondark()
|
|
32
|
+
else if theme(auto)
|
|
33
|
+
@media (prefers-color-scheme: dark)
|
|
34
|
+
ondark()
|
|
28
35
|
|
|
29
36
|
// 侧边栏弹出按钮
|
|
30
|
-
.
|
|
37
|
+
.float-panel button
|
|
31
38
|
cursor: pointer
|
|
32
39
|
color: var(--text)
|
|
33
40
|
background: none
|
|
@@ -41,8 +48,17 @@
|
|
|
41
48
|
trans1 transform
|
|
42
49
|
width: auto
|
|
43
50
|
height: 28px
|
|
51
|
+
|
|
44
52
|
// 侧边栏弹出后
|
|
45
|
-
.l_body.
|
|
53
|
+
.l_body[leftbar] .float-panel, .l_body[rightbar] .float-panel
|
|
54
|
+
box-shadow: 0 0 4px -1px $color-theme, 0 0 16px -4px $color-theme, 0 0 32px -12px $color-theme, 0 0 128px -32px $color-theme
|
|
55
|
+
|
|
56
|
+
.l_body[leftbar] .float-panel button.leftbar-toggle
|
|
57
|
+
background: var(--alpha100)
|
|
58
|
+
|
|
59
|
+
.l_body[leftbar] .float-panel button.leftbar-toggle
|
|
60
|
+
color: $color-theme
|
|
61
|
+
border-color: var(--block-border)
|
|
46
62
|
svg g
|
|
47
63
|
fill: currentColor
|
|
48
64
|
fill-opacity: 0.3
|
|
@@ -50,8 +66,19 @@
|
|
|
50
66
|
transform: translateX(2px)
|
|
51
67
|
|
|
52
68
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
69
|
+
// 侧边栏有内容时才显示弹出按钮
|
|
70
|
+
.l_body .l_right:empty+.float-panel button.rightbar-toggle
|
|
71
|
+
display: none !important
|
|
72
|
+
|
|
73
|
+
.l_body[rightbar] .float-panel button.rightbar-toggle
|
|
74
|
+
background: var(--alpha100)
|
|
75
|
+
|
|
76
|
+
.l_body[rightbar] .float-panel button.rightbar-toggle
|
|
77
|
+
color: $color-theme
|
|
78
|
+
border-color: var(--block-border)
|
|
79
|
+
svg g
|
|
80
|
+
fill: currentColor
|
|
81
|
+
fill-opacity: 0.3
|
|
82
|
+
path#sep
|
|
83
|
+
transform: translateX(2px)
|
|
84
|
+
|
package/source/css/_custom.styl
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
$color-theme = convert(hexo-config('style.color.theme'))
|
|
5
5
|
$color-accent = convert(hexo-config('style.color.accent'))
|
|
6
6
|
$color-link = convert(hexo-config('style.color.link'))
|
|
7
|
-
$color-button = convert(hexo-config('style.color.button'))
|
|
8
7
|
$color-hover = convert(hexo-config('style.color.hover'))
|
|
9
8
|
|
|
10
9
|
// 动态颜色
|
|
@@ -13,12 +12,6 @@ $color-block = convert(hexo-config('style.color.block'))
|
|
|
13
12
|
$color-code = convert(hexo-config('style.color.code'))
|
|
14
13
|
$color-text = convert(hexo-config('style.color.text'))
|
|
15
14
|
|
|
16
|
-
// @font-face
|
|
17
|
-
// font-family: 'Dosis'
|
|
18
|
-
// src: url('https://gcore.jsdelivr.net/gh/volantis-x/cdn-fonts@20.5.30/Dosis/Dosis-Medium.ttf')
|
|
19
|
-
// font-weight: normal
|
|
20
|
-
// font-style: normal
|
|
21
|
-
|
|
22
15
|
$ff-body = system-ui, "Microsoft Yahei", "Segoe UI", -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, "WenQuanYi Micro Hei", sans-serif
|
|
23
16
|
$ff-codeblock = Menlo, Monaco, Consolas, system-ui, "Courier New", monospace, sans-serif
|
|
24
17
|
$ff-code = $ff-codeblock
|
|
@@ -48,7 +41,7 @@ $fs-body = convert(hexo-config('style.font-size.body'))
|
|
|
48
41
|
$fs-code = convert(hexo-config('style.font-size.code'))
|
|
49
42
|
$fs-codeblock = convert(hexo-config('style.font-size.codeblock'))
|
|
50
43
|
|
|
51
|
-
$fsh1 = 'calc(%s +
|
|
44
|
+
$fsh1 = 'calc(%s + 9px)' % $fs-body
|
|
52
45
|
$fsh2 = 'calc(%s + 11px)' % $fs-body
|
|
53
46
|
$fsh3 = 'calc(%s + 7px)' % $fs-body
|
|
54
47
|
$fsh4 = 'calc(%s + 4px)' % $fs-body
|
|
@@ -67,31 +60,37 @@ $border-button = 4px
|
|
|
67
60
|
|
|
68
61
|
// 可以动态变化的属性
|
|
69
62
|
:root
|
|
70
|
-
--width-left: 288px
|
|
71
63
|
--width-main: 720px
|
|
72
64
|
--fsp: $fs-body
|
|
73
65
|
--fsh2: 'calc(%s + 11px)' % var(--fsp)
|
|
74
66
|
--fsh3: 'calc(%s + 7px)' % var(--fsp)
|
|
75
67
|
--fsh4: 'calc(%s + 4px)' % var(--fsp)
|
|
76
68
|
|
|
77
|
-
|
|
69
|
+
// 侧边栏文字内容宽度
|
|
70
|
+
--side-content-width: 224px
|
|
71
|
+
// 元素轮廓到容器边缘的间距
|
|
72
|
+
--gap-margin: 16px
|
|
73
|
+
// 元素文本内容到元素自身的轮廓的间距
|
|
74
|
+
--gap-padding: 16px
|
|
75
|
+
|
|
78
76
|
--gap-p: 'calc(%s + 4px)' % $fs-body // gap for paragraph
|
|
79
77
|
--gap-p-compact: 'calc(%s * 0.75)' % $fs-body
|
|
80
78
|
// desktop 2k or larger
|
|
81
79
|
@media screen and (min-width: $device-2k)
|
|
82
|
-
--gap-l: 32px
|
|
83
|
-
--width-left: 352px
|
|
84
80
|
--width-main: 780px
|
|
85
81
|
// desktop 4k or larger
|
|
86
82
|
@media screen and (min-width: $device-4k)
|
|
87
83
|
--width-main: 860px
|
|
88
|
-
--gap-l: 64px
|
|
89
84
|
// iPad 竖屏
|
|
90
85
|
@media screen and (max-width: $device-tablet)
|
|
91
|
-
--width
|
|
92
|
-
// iPad 竖屏
|
|
86
|
+
--side-content-width: 188px
|
|
93
87
|
@media screen and (max-width: $device-mobile-max)
|
|
94
|
-
--width
|
|
88
|
+
--side-content-width: 224px
|
|
89
|
+
|
|
90
|
+
// 动态计算值
|
|
91
|
+
:root
|
|
92
|
+
// 元素文本内容到容器边缘的间距
|
|
93
|
+
--gap-max: calc(var(--gap-margin) + var(--gap-padding))
|
|
95
94
|
|
|
96
95
|
// 文章布局风格
|
|
97
96
|
.l_body.story
|
|
@@ -106,10 +106,20 @@ floatable-float()
|
|
|
106
106
|
|
|
107
107
|
hoverable-card()
|
|
108
108
|
trans1 all
|
|
109
|
-
|
|
110
|
-
&:hover
|
|
111
|
-
box-shadow: 0 0 4px -2px $color-theme, 0 0 24px -8px $color-theme
|
|
112
|
-
@media (prefers-color-scheme: light)
|
|
109
|
+
onlight()
|
|
113
110
|
box-shadow: $boxshadow-card
|
|
114
111
|
&:hover
|
|
115
112
|
floatable-float()
|
|
113
|
+
ondark()
|
|
114
|
+
&:hover
|
|
115
|
+
box-shadow: 0 0 4px -2px $color-theme, 0 0 24px -8px $color-theme
|
|
116
|
+
if theme(light)
|
|
117
|
+
onlight()
|
|
118
|
+
else if theme(dark)
|
|
119
|
+
ondark()
|
|
120
|
+
else
|
|
121
|
+
@media (prefers-color-scheme: light)
|
|
122
|
+
onlight()
|
|
123
|
+
@media (prefers-color-scheme: dark)
|
|
124
|
+
ondark()
|
|
125
|
+
|