hexo-theme-fluid 1.8.13 → 1.9.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/LICENSE +674 -21
- package/README.md +17 -21
- package/_config.yml +164 -79
- package/languages/de.yml +58 -33
- package/languages/en.yml +58 -33
- package/languages/eo.yml +58 -33
- package/languages/es.yml +69 -0
- package/languages/ja.yml +58 -33
- package/languages/zh-CN.yml +58 -33
- package/languages/zh-HK.yml +69 -0
- package/languages/zh-TW.yml +58 -33
- package/layout/.DS_Store +0 -0
- package/layout/404.ejs +3 -1
- package/layout/{_partial → _partials}/archive-list.ejs +4 -4
- package/layout/_partials/category-chains.ejs +19 -0
- package/layout/_partials/category-list.ejs +62 -0
- package/layout/{_partial → _partials}/comments/changyan.ejs +0 -0
- package/layout/{_partial → _partials}/comments/cusdis.ejs +0 -0
- package/layout/{_partial → _partials}/comments/disqus.ejs +0 -0
- package/layout/_partials/comments/giscus.ejs +36 -0
- package/layout/{_partial → _partials}/comments/gitalk.ejs +0 -0
- package/layout/{_partial → _partials}/comments/livere.ejs +0 -0
- package/layout/{_partial → _partials}/comments/remark42.ejs +0 -0
- package/layout/{_partial → _partials}/comments/twikoo.ejs +3 -1
- package/layout/{_partial → _partials}/comments/utterances.ejs +1 -1
- package/layout/{_partial → _partials}/comments/valine.ejs +3 -1
- package/layout/{_partial → _partials}/comments/waline.ejs +6 -3
- package/layout/_partials/comments.ejs +5 -0
- package/layout/_partials/css.ejs +26 -0
- package/layout/_partials/footer/beian.ejs +33 -0
- package/layout/_partials/footer/statistics.ejs +39 -0
- package/layout/_partials/footer.ejs +18 -0
- package/layout/{_partial → _partials}/head.ejs +7 -1
- package/layout/_partials/header/banner.ejs +33 -0
- package/layout/{_partial/nav.ejs → _partials/header/navigation.ejs} +3 -2
- package/layout/_partials/header.ejs +8 -0
- package/layout/{_partial → _partials}/paginator.ejs +0 -0
- package/layout/_partials/plugins/analytics.ejs +87 -0
- package/layout/_partials/plugins/anchorjs.ejs +24 -0
- package/layout/_partials/plugins/code-widget.ejs +71 -0
- package/layout/_partials/plugins/fancybox.ejs +11 -0
- package/layout/_partials/plugins/highlight.ejs +13 -0
- package/layout/_partials/plugins/math.ejs +46 -0
- package/layout/_partials/plugins/mermaid.ejs +5 -0
- package/layout/{_partial → _partials}/plugins/nprogress.ejs +0 -0
- package/layout/_partials/plugins/typed.ejs +48 -0
- package/layout/_partials/post/category-bar.ejs +18 -0
- package/layout/_partials/post/copyright.ejs +56 -0
- package/layout/_partials/post/meta-bottom.ejs +16 -0
- package/layout/_partials/post/meta-top.ejs +63 -0
- package/layout/_partials/post/sidebar-left.ejs +10 -0
- package/layout/_partials/post/sidebar-right.ejs +10 -0
- package/layout/_partials/post/toc.ejs +34 -0
- package/layout/_partials/scripts.ejs +32 -0
- package/layout/{_partial → _partials}/search.ejs +2 -3
- package/layout/about.ejs +5 -3
- package/layout/archive.ejs +1 -1
- package/layout/categories.ejs +10 -59
- package/layout/category.ejs +1 -1
- package/layout/index.ejs +13 -15
- package/layout/layout.ejs +19 -39
- package/layout/links.ejs +2 -8
- package/layout/page.ejs +28 -12
- package/layout/post.ejs +65 -59
- package/layout/tag.ejs +1 -1
- package/package.json +11 -3
- package/scripts/.DS_Store +0 -0
- package/scripts/events/.DS_Store +0 -0
- package/scripts/events/index.js +1 -0
- package/scripts/events/lib/compatible-configs.js +7 -8
- package/scripts/events/lib/footnote.js +1 -1
- package/scripts/events/lib/hello.js +6 -2
- package/scripts/events/lib/highlight.js +93 -24
- package/scripts/events/lib/injects.js +118 -0
- package/scripts/events/lib/merge-configs.js +37 -7
- package/scripts/filters/default-injects.js +27 -0
- package/scripts/filters/post-filter.js +7 -0
- package/scripts/helpers/date.js +25 -0
- package/scripts/helpers/engine.js +9 -0
- package/scripts/helpers/export-config.js +8 -0
- package/scripts/helpers/import.js +24 -0
- package/scripts/helpers/injects.js +7 -0
- package/scripts/helpers/scope.js +44 -0
- package/scripts/helpers/utils.js +17 -2
- package/scripts/tags/checkbox.js +4 -2
- package/scripts/utils/.DS_Store +0 -0
- package/scripts/utils/object.js +5 -0
- package/scripts/utils/resolve.js +15 -0
- package/source/.DS_Store +0 -0
- package/source/css/_pages/_archive/archive.styl +28 -0
- package/source/css/_pages/_base/_widget/anchorjs.styl +8 -0
- package/source/css/_pages/_base/_widget/banner.styl +2 -11
- package/source/css/_pages/_base/_widget/board.styl +1 -4
- package/source/css/_pages/_base/_widget/code-widget.styl +36 -0
- package/source/css/_pages/_base/_widget/copyright.styl +90 -0
- package/source/css/_pages/_base/_widget/footer.styl +4 -1
- package/source/css/_pages/_base/_widget/header.styl +161 -2
- package/source/css/_pages/_base/_widget/modal.styl +100 -0
- package/source/css/_pages/_base/_widget/ngrogress.styl +12 -0
- package/source/css/_pages/_base/_widget/noscript.styl +12 -0
- package/source/css/_pages/_base/_widget/pagination.styl +23 -0
- package/source/css/_pages/_base/_widget/scroll-btn.styl +2 -15
- package/source/css/_pages/_base/_widget/toc.styl +75 -0
- package/source/css/_pages/_base/base.styl +23 -3
- package/source/css/_pages/_base/color-schema.styl +30 -58
- package/source/css/_pages/_base/inline.styl +2 -2
- package/source/css/_pages/_category/category-bar.styl +59 -0
- package/source/css/_pages/_category/category-chain.styl +6 -0
- package/source/css/_pages/_category/{categories.styl → category-list.styl} +17 -11
- package/source/css/_pages/_index/index.styl +7 -5
- package/source/css/_pages/_links/links.styl +2 -1
- package/source/css/_pages/_post/comment.styl +27 -0
- package/source/css/_pages/_post/highlight.styl +65 -0
- package/source/css/_pages/_post/markdown.styl +91 -0
- package/source/css/_pages/_post/{post.styl → post-page.styl} +44 -75
- package/source/css/_pages/_post/{tag_plugin.styl → post-tag.styl} +29 -27
- package/source/css/_variables/base.styl +30 -9
- package/source/css/highlight-dark.styl +6 -0
- package/source/css/highlight.styl +6 -0
- package/source/css/main.styl +7 -0
- package/source/img/.DS_Store +0 -0
- package/source/img/default.png +0 -0
- package/source/img/{favicon.png → fluid.png} +0 -0
- package/source/js/boot.js +1 -9
- package/source/js/color-schema.js +52 -7
- package/source/js/events.js +15 -15
- package/source/js/leancloud.js +9 -2
- package/source/js/local-search.js +2 -2
- package/source/js/plugins.js +26 -94
- package/source/js/utils.js +28 -12
- package/.editorconfig +0 -13
- package/.eslintrc +0 -224
- package/.gitattributes +0 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -28
- package/.github/ISSUE_TEMPLATE/bug_report_zh.md +0 -33
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/ISSUE_TEMPLATE/feature_request_zh.md +0 -20
- package/.github/ISSUE_TEMPLATE/question.md +0 -11
- package/.github/ISSUE_TEMPLATE/question_zh.md +0 -14
- package/.github/workflows/limit.yaml +0 -18
- package/README_en.md +0 -125
- package/layout/_partial/beian.ejs +0 -36
- package/layout/_partial/css.ejs +0 -47
- package/layout/_partial/footer.ejs +0 -11
- package/layout/_partial/plugins/analytics.ejs +0 -66
- package/layout/_partial/plugins/math.ejs +0 -69
- package/layout/_partial/plugins/mermaid.ejs +0 -24
- package/layout/_partial/plugins/typed.ejs +0 -41
- package/layout/_partial/post-meta.ejs +0 -51
- package/layout/_partial/scripts.ejs +0 -72
- package/layout/_partial/statistics.ejs +0 -43
- package/layout/_partial/toc.ejs +0 -4
- package/source/css/_pages/_base/_widget/copy-btn.styl +0 -42
- package/source/css/_pages/_base/rewrite.styl +0 -556
- package/source/css/_pages/_category/category.styl +0 -0
|
@@ -11,7 +11,7 @@ module.exports = (hexo) => {
|
|
|
11
11
|
let dataConfig = {};
|
|
12
12
|
let dataStaticConfig = {};
|
|
13
13
|
|
|
14
|
-
if (hexo.locals.get) {
|
|
14
|
+
if (hexo.locals.get instanceof Function) {
|
|
15
15
|
const data = hexo.locals.get('data');
|
|
16
16
|
if (data && isNotEmptyObject(data.fluid_config)) {
|
|
17
17
|
dataConfig = data.fluid_config;
|
|
@@ -25,32 +25,62 @@ module.exports = (hexo) => {
|
|
|
25
25
|
if (data && isNotEmptyObject(data.fluid_static_prefix)) {
|
|
26
26
|
dataStaticConfig = data.fluid_static_prefix;
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
const { language } = hexo.config;
|
|
30
|
+
const { i18n } = hexo.theme;
|
|
31
|
+
const langConfigMap = {};
|
|
32
|
+
for (const key in data) {
|
|
33
|
+
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
|
34
|
+
if (/^languages\/.+$/.test(key)) {
|
|
35
|
+
langConfigMap[key.replace('languages/', '')] = data[key];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (isNotEmptyObject(langConfigMap)) {
|
|
40
|
+
const mergeLang = (lang) => {
|
|
41
|
+
if (langConfigMap[lang]) {
|
|
42
|
+
i18n.set(lang, objUtil.merge({}, i18n.get([lang]), langConfigMap[lang]));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
if (Array.isArray(language)) {
|
|
46
|
+
for (const lang of language) {
|
|
47
|
+
mergeLang(lang);
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
mergeLang(language);
|
|
51
|
+
}
|
|
52
|
+
if (isZh) {
|
|
53
|
+
hexo.log.debug('[Fluid] 读取 source/_data/languages/*.yml 文件覆盖语言配置');
|
|
54
|
+
} else {
|
|
55
|
+
hexo.log.debug('[Fluid] Merge language config from source/_data/languages/*.yml');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
28
58
|
}
|
|
29
59
|
|
|
30
60
|
if (isNotEmptyObject(hexo.config.theme_config)) {
|
|
31
61
|
hexo.theme.config = objUtil.merge({}, hexo.theme.config, hexo.config.theme_config);
|
|
32
62
|
if (isZh) {
|
|
33
|
-
hexo.log.
|
|
63
|
+
hexo.log.debug('[Fluid] 读取 _config.yml 中 theme_config 配置项覆盖主题配置');
|
|
34
64
|
} else {
|
|
35
|
-
hexo.log.
|
|
65
|
+
hexo.log.debug('[Fluid] Merge theme config from theme_config in _config.yml');
|
|
36
66
|
}
|
|
37
67
|
}
|
|
38
68
|
|
|
39
69
|
if (isNotEmptyObject(dataStaticConfig)) {
|
|
40
70
|
hexo.theme.config.static_prefix = objUtil.merge({}, hexo.theme.config.static_prefix, dataStaticConfig);
|
|
41
71
|
if (isZh) {
|
|
42
|
-
hexo.log.
|
|
72
|
+
hexo.log.debug('[Fluid] 读取 source/_data/fluid_static_prefix.yml 文件覆盖主题配置');
|
|
43
73
|
} else {
|
|
44
|
-
hexo.log.
|
|
74
|
+
hexo.log.debug('[Fluid] Merge theme config from source/_data/fluid_static_prefix.yml');
|
|
45
75
|
}
|
|
46
76
|
}
|
|
47
77
|
|
|
48
78
|
if (isNotEmptyObject(dataConfig)) {
|
|
49
79
|
hexo.theme.config = objUtil.merge({}, hexo.theme.config, dataConfig);
|
|
50
80
|
if (isZh) {
|
|
51
|
-
hexo.log.
|
|
81
|
+
hexo.log.debug('[Fluid] 读取 source/_data/fluid_config.yml 文件覆盖主题配置');
|
|
52
82
|
} else {
|
|
53
|
-
hexo.log.
|
|
83
|
+
hexo.log.debug('[Fluid] Merge theme config from source/_data/fluid_config.yml');
|
|
54
84
|
}
|
|
55
85
|
}
|
|
56
86
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* global hexo */
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
hexo.extend.filter.register('theme_inject', function(injects) {
|
|
8
|
+
injects.header.file('default', path.join(hexo.theme_dir, 'layout/_partials/header.ejs'));
|
|
9
|
+
injects.footer.file('default', path.join(hexo.theme_dir, 'layout/_partials/footer.ejs'));
|
|
10
|
+
|
|
11
|
+
injects.postLeft.file('default', path.join(hexo.theme_dir, 'layout/_partials/post/sidebar-left.ejs'));
|
|
12
|
+
injects.postRight.file('default', path.join(hexo.theme_dir, 'layout/_partials/post/sidebar-right.ejs'));
|
|
13
|
+
injects.postMetaTop.file('default', path.join(hexo.theme_dir, 'layout/_partials/post/meta-top.ejs'));
|
|
14
|
+
injects.postMetaBottom.file('default', path.join(hexo.theme_dir, 'layout/_partials/post/meta-bottom.ejs'));
|
|
15
|
+
if (hexo.theme.config.post.copyright.enable) {
|
|
16
|
+
injects.postCopyright.file('default', path.join(hexo.theme_dir, 'layout/_partials/post/copyright.ejs'));
|
|
17
|
+
}
|
|
18
|
+
if (hexo.theme.config.post.comments.enable) {
|
|
19
|
+
injects.postComments.file('default', path.join(hexo.theme_dir, 'layout/_partials/comments.ejs'));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
injects.pageComments.file('default', path.join(hexo.theme_dir, 'layout/_partials/comments.ejs'));
|
|
23
|
+
|
|
24
|
+
if (hexo.theme.config.links.comments.enable) {
|
|
25
|
+
injects.linksComments.file('default', path.join(hexo.theme_dir, 'layout/_partials/comments.ejs'));
|
|
26
|
+
}
|
|
27
|
+
}, -99);
|
|
@@ -42,3 +42,10 @@ hexo.extend.generator.register('post', function(locals) {
|
|
|
42
42
|
)
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
|
+
|
|
46
|
+
// 渲染文章后的过滤
|
|
47
|
+
hexo.extend.filter.register('after_post_render', (page) => {
|
|
48
|
+
// 移除 hexo-renderer-pandoc 生成的 <colgroup>
|
|
49
|
+
page.content = page.content.replace(/<colgroup>.+?<\/colgroup>/gims, '');
|
|
50
|
+
return page;
|
|
51
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* global hexo */
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
const moment = require('moment');
|
|
6
|
+
const { isMoment } = moment;
|
|
7
|
+
|
|
8
|
+
hexo.extend.helper.register('compare_date', function(date1, date2) {
|
|
9
|
+
if (!date1) {
|
|
10
|
+
return -1;
|
|
11
|
+
}
|
|
12
|
+
if (!date2) {
|
|
13
|
+
return 1;
|
|
14
|
+
}
|
|
15
|
+
const m1 = isMoment(date1) ? date1 : moment(date1);
|
|
16
|
+
const m2 = isMoment(date2) ? date2 : moment(date2);
|
|
17
|
+
const diff = m1.diff(m2);
|
|
18
|
+
if (diff < 0) {
|
|
19
|
+
return -1;
|
|
20
|
+
} else if (diff > 0) {
|
|
21
|
+
return 1;
|
|
22
|
+
} else {
|
|
23
|
+
return 0;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
@@ -17,7 +17,9 @@ hexo.extend.helper.register('export_config', function() {
|
|
|
17
17
|
typing : theme.fun_features.typing,
|
|
18
18
|
anchorjs : theme.fun_features.anchorjs,
|
|
19
19
|
progressbar : theme.fun_features.progressbar,
|
|
20
|
+
code_language: theme.code.language,
|
|
20
21
|
copy_btn : theme.code.copy_btn,
|
|
22
|
+
image_caption: theme.post.image_caption,
|
|
21
23
|
image_zoom : theme.post.image_zoom,
|
|
22
24
|
toc : theme.post.toc,
|
|
23
25
|
lazyload : theme.lazyload,
|
|
@@ -26,6 +28,12 @@ hexo.extend.helper.register('export_config', function() {
|
|
|
26
28
|
};
|
|
27
29
|
return `<script id="fluid-configs">
|
|
28
30
|
var Fluid = window.Fluid || {};
|
|
31
|
+
Fluid.ctx = Object.assign({}, Fluid.ctx)
|
|
29
32
|
var CONFIG = ${JSON.stringify(exportConfig)};
|
|
33
|
+
|
|
34
|
+
if (CONFIG.web_analytics.follow_dnt) {
|
|
35
|
+
var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
|
|
36
|
+
Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
|
|
37
|
+
}
|
|
30
38
|
</script>`;
|
|
31
39
|
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* global hexo */
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
hexo.extend.helper.register('import_js', function(base, relative, ex = '') {
|
|
6
|
+
if (!Array.isArray(this.page.script_snippets)) {
|
|
7
|
+
this.page.script_snippets = [];
|
|
8
|
+
}
|
|
9
|
+
this.page.script_snippets.push(this.js_ex(base, relative, ex));
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
hexo.extend.helper.register('import_script', function(snippet) {
|
|
13
|
+
if (!Array.isArray(this.page.script_snippets)) {
|
|
14
|
+
this.page.script_snippets = [];
|
|
15
|
+
}
|
|
16
|
+
this.page.script_snippets.push(snippet);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
hexo.extend.helper.register('import_css', function(base, relative, ex = '') {
|
|
20
|
+
if (!Array.isArray(this.page.css_snippets)) {
|
|
21
|
+
this.page.css_snippets = [];
|
|
22
|
+
}
|
|
23
|
+
this.page.css_snippets.push(this.css_ex(base, relative, ex));
|
|
24
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* global hexo */
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
const pageInScope = (page, scope) => {
|
|
6
|
+
switch (scope) {
|
|
7
|
+
case 'home':
|
|
8
|
+
return Boolean(page.__index);
|
|
9
|
+
case 'post':
|
|
10
|
+
return Boolean(page.__post);
|
|
11
|
+
case 'archives' || 'archive':
|
|
12
|
+
return Boolean(page.archive);
|
|
13
|
+
case 'categories' || 'category':
|
|
14
|
+
return page.layout === 'categories' || page.layout === 'category';
|
|
15
|
+
case 'tags' || 'tag':
|
|
16
|
+
return page.layout === 'tags' || page.layout === 'tag';
|
|
17
|
+
case 'about':
|
|
18
|
+
return page.layout === 'about';
|
|
19
|
+
case 'links' || 'link':
|
|
20
|
+
return page.layout === 'links';
|
|
21
|
+
case '404':
|
|
22
|
+
return page.layout === '404';
|
|
23
|
+
case 'page' || 'custom':
|
|
24
|
+
return Boolean(page.__page);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
hexo.extend.helper.register('in_scope', function(scope) {
|
|
29
|
+
if (!scope || scope.length === 0) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (Array.isArray(scope)) {
|
|
34
|
+
for (const each of scope) {
|
|
35
|
+
if (pageInScope(this.page, each)) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
return pageInScope(this.page, scope);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return false;
|
|
44
|
+
});
|
package/scripts/helpers/utils.js
CHANGED
|
@@ -3,12 +3,27 @@
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
const crypto = require('crypto');
|
|
6
|
+
const { decodeURL } = require('hexo-util');
|
|
6
7
|
const compareVersions = require('../../scripts/utils/compare-versions');
|
|
7
8
|
|
|
8
9
|
hexo.extend.helper.register('md5', function(string) {
|
|
9
10
|
return crypto.createHash('md5').update(string).digest('hex');
|
|
10
11
|
});
|
|
11
12
|
|
|
12
|
-
hexo.extend.helper.register('
|
|
13
|
-
|
|
13
|
+
hexo.extend.helper.register('require_version', function(current, require) {
|
|
14
|
+
const verRe = current.match(/[@/](\d{1,2})\.?(\d{0,2})\.?(\d{0,2})/);
|
|
15
|
+
if (verRe && verRe.length >= 4) {
|
|
16
|
+
const ver = `${verRe[1]}.${verRe[2] || 'x'}.${verRe[3] || 'x'}`;
|
|
17
|
+
return compareVersions(ver, require) >= 0;
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
14
20
|
});
|
|
21
|
+
|
|
22
|
+
hexo.extend.helper.register('deduplicate', function(arr) {
|
|
23
|
+
if (!Array.isArray(arr)) {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
return [...new Set(arr)];
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
hexo.extend.helper.register('decode_url', decodeURL);
|
package/scripts/tags/checkbox.js
CHANGED
|
@@ -7,17 +7,19 @@ const checkbox = (args) => {
|
|
|
7
7
|
args = args.join(' ').split(',');
|
|
8
8
|
const text = (args[0] || '').trim();
|
|
9
9
|
|
|
10
|
+
!text && hexo.log.warn('[Fluid] Checkbox text must be defined!');
|
|
11
|
+
|
|
10
12
|
if (text === 'checked' || text === 'true' || text === 'false') {
|
|
11
13
|
const checked = text === 'checked' || text === 'true';
|
|
12
14
|
return `<input type="checkbox" disabled ${checked ? 'checked="checked"' : ''}>`;
|
|
13
15
|
}
|
|
14
|
-
!text && hexo.log.warn('[Fluid] Checkbox text must be defined!');
|
|
15
16
|
|
|
16
17
|
const checked = (args[1] || '').length > 0 && args[1].trim() !== 'false';
|
|
17
18
|
const inline = (args[2] || '').length > 0 && args[2].trim() !== 'false';
|
|
19
|
+
const enabled = (args[3] || '').length > 0 && args[3].trim() === 'false';
|
|
18
20
|
|
|
19
21
|
return `${!inline ? '<div>' : ''}
|
|
20
|
-
<input type="checkbox" disabled ${checked ? 'checked="checked"' : ''}>${text}
|
|
22
|
+
<input type="checkbox" ${enabled ? '' : 'disabled'} ${checked ? 'checked="checked"' : ''}>${text}
|
|
21
23
|
${!inline ? '</div>' : ''}`;
|
|
22
24
|
|
|
23
25
|
};
|
|
Binary file
|
package/scripts/utils/object.js
CHANGED
|
@@ -8,6 +8,10 @@ const isNotEmptyObject = (obj) => {
|
|
|
8
8
|
return obj && typeof obj === 'object' && Object.getOwnPropertyNames(obj).length !== 0;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
const isEmptyObject = (obj) => {
|
|
12
|
+
return !isNotEmptyObject(obj);
|
|
13
|
+
};
|
|
14
|
+
|
|
11
15
|
const merge = (target, ...sources) => {
|
|
12
16
|
for (const source of sources) {
|
|
13
17
|
for (const key in source) {
|
|
@@ -27,5 +31,6 @@ const merge = (target, ...sources) => {
|
|
|
27
31
|
module.exports = {
|
|
28
32
|
isObject,
|
|
29
33
|
isNotEmptyObject,
|
|
34
|
+
isEmptyObject,
|
|
30
35
|
merge
|
|
31
36
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const resolveModule = (name, file = '') => {
|
|
6
|
+
let dir;
|
|
7
|
+
try {
|
|
8
|
+
dir = path.dirname(require.resolve(`${name}/package.json`));
|
|
9
|
+
} catch (error) {
|
|
10
|
+
return '';
|
|
11
|
+
}
|
|
12
|
+
return `${dir}/${file}`;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
module.exports = resolveModule;
|
package/source/.DS_Store
ADDED
|
Binary file
|
|
@@ -1,3 +1,31 @@
|
|
|
1
1
|
.list-group
|
|
2
2
|
a ~ p.h5
|
|
3
3
|
margin-top 1rem
|
|
4
|
+
|
|
5
|
+
.list-group-item
|
|
6
|
+
display flex
|
|
7
|
+
background-color transparent
|
|
8
|
+
border 0
|
|
9
|
+
|
|
10
|
+
time
|
|
11
|
+
flex 0 0 5rem
|
|
12
|
+
|
|
13
|
+
.list-group-item-title
|
|
14
|
+
white-space nowrap
|
|
15
|
+
overflow hidden
|
|
16
|
+
text-overflow ellipsis
|
|
17
|
+
|
|
18
|
+
@media (max-width: 575px)
|
|
19
|
+
.list-group-item
|
|
20
|
+
font-size .95rem
|
|
21
|
+
padding 0.5rem 0.75rem
|
|
22
|
+
|
|
23
|
+
time
|
|
24
|
+
flex 0 0 4rem
|
|
25
|
+
|
|
26
|
+
.list-group-item-action
|
|
27
|
+
color var(--text-color)
|
|
28
|
+
|
|
29
|
+
&:focus, &:hover
|
|
30
|
+
color var(--link-hover-color)
|
|
31
|
+
background-color var(--link-hover-bg-color)
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
position relative
|
|
4
4
|
overflow hidden
|
|
5
5
|
cursor default
|
|
6
|
-
overflow-wrap break-word
|
|
7
6
|
|
|
8
7
|
.mask
|
|
9
8
|
position absolute
|
|
@@ -11,23 +10,15 @@
|
|
|
11
10
|
height 100%
|
|
12
11
|
background-color rgba(0, 0, 0, 0.3)
|
|
13
12
|
|
|
14
|
-
.page-header
|
|
15
|
-
color #fff
|
|
16
|
-
max-width calc(960px - 6rem)
|
|
17
|
-
width 80%
|
|
18
|
-
|
|
19
|
-
@media (max-width: 575px)
|
|
20
|
-
.page-header, .page-header .iconfont
|
|
21
|
-
font-size 0.9rem
|
|
22
|
-
|
|
23
13
|
&[parallax="true"]
|
|
24
14
|
will-change transform
|
|
25
15
|
-webkit-transform-style preserve-3d
|
|
26
16
|
-webkit-backface-visibility hidden
|
|
17
|
+
transition transform .05s ease-out
|
|
27
18
|
|
|
28
19
|
if $banner-width-height-ratio > 0
|
|
29
20
|
@media (max-width: unit($banner-width-height-ratio * 100, "vh"))
|
|
30
|
-
header
|
|
21
|
+
.header-inner
|
|
31
22
|
max-height unit(100 / $banner-width-height-ratio, "vw")
|
|
32
23
|
|
|
33
24
|
#board
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
#board
|
|
2
2
|
position relative
|
|
3
3
|
margin-top -2rem
|
|
4
|
+
padding 3rem 0
|
|
4
5
|
background-color var(--board-bg-color)
|
|
5
6
|
transition background-color .2s ease-in-out
|
|
6
7
|
border-radius 0.5rem
|
|
7
8
|
z-index 3
|
|
8
9
|
-webkit-box-shadow 0 12px 15px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19)
|
|
9
10
|
box-shadow 0 12px 15px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19)
|
|
10
|
-
|
|
11
|
-
@media (max-width: 767px)
|
|
12
|
-
#board
|
|
13
|
-
overflow-x hidden
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.code-widget
|
|
2
|
+
display inline-block
|
|
3
|
+
background-color transparent
|
|
4
|
+
font-size .75rem
|
|
5
|
+
line-height 1
|
|
6
|
+
font-weight bold
|
|
7
|
+
padding .3rem .1rem .1rem .1rem
|
|
8
|
+
position absolute
|
|
9
|
+
right .45rem
|
|
10
|
+
top .15rem
|
|
11
|
+
z-index 1
|
|
12
|
+
|
|
13
|
+
.code-widget-light
|
|
14
|
+
color #999
|
|
15
|
+
|
|
16
|
+
.code-widget-dark
|
|
17
|
+
color #bababa
|
|
18
|
+
|
|
19
|
+
.copy-btn
|
|
20
|
+
cursor pointer
|
|
21
|
+
user-select none
|
|
22
|
+
-webkit-appearance none
|
|
23
|
+
outline none
|
|
24
|
+
|
|
25
|
+
& > i
|
|
26
|
+
font-size .75rem !important
|
|
27
|
+
font-weight 400
|
|
28
|
+
margin-right .15rem
|
|
29
|
+
opacity 0
|
|
30
|
+
transition opacity .2s ease-in-out
|
|
31
|
+
|
|
32
|
+
.markdown-body pre:hover > .copy-btn > i
|
|
33
|
+
opacity 0.9
|
|
34
|
+
|
|
35
|
+
.markdown-body pre:hover > .copy-btn, .markdown-body pre:not(:hover) > .copy-btn
|
|
36
|
+
outline none
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// Modified from [hexo-theme-icarus](https://github.com/ppoffice/hexo-theme-icarus)
|
|
2
|
+
|
|
3
|
+
.license-box
|
|
4
|
+
background-color rgba(#1b1f23, .05)
|
|
5
|
+
transition background-color .2s ease-in-out
|
|
6
|
+
border-radius 4px
|
|
7
|
+
font-size .9rem
|
|
8
|
+
overflow hidden
|
|
9
|
+
padding 1.25rem
|
|
10
|
+
position relative
|
|
11
|
+
z-index 1
|
|
12
|
+
|
|
13
|
+
.license-icon
|
|
14
|
+
position absolute
|
|
15
|
+
top 50%
|
|
16
|
+
left 100%
|
|
17
|
+
|
|
18
|
+
&::after
|
|
19
|
+
content "\e8e4"
|
|
20
|
+
font-size 12.5rem
|
|
21
|
+
line-height 1
|
|
22
|
+
opacity 0.1
|
|
23
|
+
position relative
|
|
24
|
+
left -.85em
|
|
25
|
+
bottom .5em
|
|
26
|
+
z-index -1
|
|
27
|
+
|
|
28
|
+
.license-title
|
|
29
|
+
margin-bottom 1rem
|
|
30
|
+
|
|
31
|
+
div:nth-child(1)
|
|
32
|
+
line-height 1.2
|
|
33
|
+
margin-bottom .25rem
|
|
34
|
+
|
|
35
|
+
div:nth-child(2)
|
|
36
|
+
color var(--sec-text-color)
|
|
37
|
+
font-size .8rem
|
|
38
|
+
|
|
39
|
+
.license-meta
|
|
40
|
+
align-items center
|
|
41
|
+
display flex
|
|
42
|
+
flex-wrap wrap
|
|
43
|
+
justify-content flex-start
|
|
44
|
+
|
|
45
|
+
.license-meta-item
|
|
46
|
+
align-items center
|
|
47
|
+
justify-content center
|
|
48
|
+
margin-right 1.5rem
|
|
49
|
+
|
|
50
|
+
div:nth-child(1)
|
|
51
|
+
color var(--sec-text-color)
|
|
52
|
+
font-size .8rem
|
|
53
|
+
font-weight normal
|
|
54
|
+
|
|
55
|
+
i.iconfont
|
|
56
|
+
font-size 1rem
|
|
57
|
+
|
|
58
|
+
@media (max-width: 575px) and (min-width: 425px)
|
|
59
|
+
.license-meta
|
|
60
|
+
|
|
61
|
+
.license-meta-item
|
|
62
|
+
display flex
|
|
63
|
+
justify-content flex-start
|
|
64
|
+
flex-wrap wrap
|
|
65
|
+
font-size .8rem
|
|
66
|
+
flex 0 0 50%
|
|
67
|
+
max-width 50%
|
|
68
|
+
margin-right 0
|
|
69
|
+
|
|
70
|
+
div:nth-child(1)
|
|
71
|
+
margin-right .5rem
|
|
72
|
+
|
|
73
|
+
.license-meta-date
|
|
74
|
+
order -1
|
|
75
|
+
|
|
76
|
+
@media (max-width: 424px)
|
|
77
|
+
&::after
|
|
78
|
+
top -65px
|
|
79
|
+
|
|
80
|
+
.license-meta
|
|
81
|
+
flex-direction column
|
|
82
|
+
align-items flex-start
|
|
83
|
+
|
|
84
|
+
.license-meta-item
|
|
85
|
+
display flex
|
|
86
|
+
flex-wrap wrap
|
|
87
|
+
font-size .8rem
|
|
88
|
+
|
|
89
|
+
div:nth-child(1)
|
|
90
|
+
margin-right .5rem
|