13 Commits

Author SHA1 Message Date
shenyu
5a4edd6483 1.8.23 2021-05-24 11:29:16 +08:00
shenyu
0163b6bfe5 🛠️ hexo scripts 2021-05-24 11:28:56 +08:00
shenyu
1c857a0c5f 1.8.22 2021-05-15 12:48:41 +08:00
shenyu
302c6080fd 🐛 fix: float btns 2021-05-15 12:48:29 +08:00
shenyu
ec47bd254a Merge branch 'master' of https://github.com/Shen-Yu/hexo-theme-ayer 2021-04-28 10:37:59 +08:00
shenyu
42a6eb0c33 1.8.21 2021-04-28 10:37:27 +08:00
shenyu
0c0ea3312c 💄 fix: sidebar overflow scroll 2021-04-28 10:37:17 +08:00
Eric Shen
1e0275d757 Merge pull request #116 from MHG-LAB/master
minivaline v6
2021-04-26 14:23:49 +08:00
MHuiG
c5f8d5d058 minivaline v6 dark 2021-04-19 18:54:39 +08:00
MHuiG
38e99de4fb minivaline v6 2021-04-19 18:43:10 +08:00
shenyu
24be666717 🙈 update: ignore 2021-04-14 11:52:50 +08:00
shenyu
4991ad5085 1.8.20 2021-04-14 11:26:24 +08:00
shenyu
ed96a4ac21 feat: mermaid 2021-04-14 11:26:09 +08:00
15 changed files with 250 additions and 162 deletions

1
.gitignore vendored
View File

@@ -7,3 +7,4 @@ package-lock.json
node_modules/ node_modules/
.cache .cache
.history .history
_bak.yml

View File

@@ -1,3 +1,4 @@
.cache/ .cache/
.history/ .history/
.github/ .github/
_bak.yml

View File

@@ -157,11 +157,10 @@ katex:
allpost: true allpost: true
copy_tex: false copy_tex: false
# mermaid 三个选项缺一不可 # mermaid流程图 三个选项缺一不可(https://mermaid-js.github.io/mermaid/)
mermaid: mermaid:
enable: true enable: false
version: 8.5.2 cdn: https://cdn.jsdelivr.net/npm/mermaid@8.9.2/dist/mermaid.min.js
cdn: https://cdn.bootcdn.net/ajax/libs/mermaid
theme: forest theme: forest
# 网站成立年份(默认为 2019若填入年份小于当前年份则显示为 2018-2019 类似的格式) # 网站成立年份(默认为 2019若填入年份小于当前年份则显示为 2018-2019 类似的格式)
@@ -234,12 +233,10 @@ twikoo:
# See: https://github.com/MiniValine/MiniValine # See: https://github.com/MiniValine/MiniValine
minivaline: minivaline:
enable: false enable: false
md: true # 更多选项 https://minivaline.js.org/docs/cn/#/Options 按照yml格式继续填写即可 (除了 [el] 选项)
# 更多选项 https://minivaline.js.org/docs/cn/#/Options 按照yml格式继续填写即可 (除了 [el] 选项)
# emoticonUrl 等列表选项 可参考 https://github.com/MiniValine/hexo-next-minivaline # emoticonUrl 等列表选项 可参考 https://github.com/MiniValine/hexo-next-minivaline
# 下面是一个例子: # 下面是一个例子:
backend: waline serverURL: https://minivaline.your-domain.com
serverURL: https://waline.vercel.app
# 首页广告配置 # 首页广告配置
# 可以根据需要自行增加ad_3ad_4...留空则不显示建议图片和url不要带ad等关键词否则可能会被adblock等插件屏蔽 # 可以根据需要自行增加ad_3ad_4...留空则不显示建议图片和url不要带ad等关键词否则可能会被adblock等插件屏蔽
@@ -253,4 +250,4 @@ ads:
title: 云服务器全球购低至2折 title: 云服务器全球购低至2折
img: https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/ten_2.jpg img: https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/ten_2.jpg
url: https://curl.qcloud.com/kvO7hb43 url: https://curl.qcloud.com/kvO7hb43
width: 300 width: 300

View File

@@ -1,75 +1,57 @@
<%- js('/js/jquery-2.0.3.min') %> <%- js('/js/jquery-2.0.3.min') %> <%- js('/js/lazyload.min') %>
<%- js('/js/lazyload.min') %>
<!-- Tocbot --> <!-- Tocbot -->
<% if (theme.toc && is_post() && !page.no_toc){ %> <% if (theme.toc && is_post() && !page.no_toc){ %> <%- js('/js/tocbot.min') %>
<%- js('/js/tocbot.min') %>
<script> <script>
tocbot.init({ tocbot.init({
tocSelector: '.tocbot', tocSelector: ".tocbot",
contentSelector: '.article-entry', contentSelector: ".article-entry",
headingSelector: 'h1, h2, h3, h4, h5, h6', headingSelector: "h1, h2, h3, h4, h5, h6",
hasInnerContainers: true, hasInnerContainers: true,
scrollSmooth: true, scrollSmooth: true,
scrollContainer: 'main', scrollContainer: "main",
positionFixedSelector: '.tocbot', positionFixedSelector: ".tocbot",
positionFixedClass: 'is-position-fixed', positionFixedClass: "is-position-fixed",
fixedSidebarOffset: 'auto' fixedSidebarOffset: "auto",
}); });
</script> </script>
<% } %> <% } %>
<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css"> <link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js"></script>
<%- js('dist/main') %> <%- js('dist/main') %>
<!-- ImageViewer --> <!-- ImageViewer -->
<% if (theme.image_viewer){ %> <% if (theme.image_viewer){ %> <%- partial('viewer') %> <% } %>
<%- partial('viewer') %>
<% } %>
<!-- MathJax --> <!-- MathJax -->
<% if (theme.mathjax){ %> <% if (theme.mathjax){ %> <%- partial('mathjax') %>
<%- partial('mathjax') %>
<script> <script>
var ayerConfig = { var ayerConfig = {
mathjax: true mathjax: true,
} };
</script> </script>
<% } %> <% } %>
<!-- Katex --> <!-- Katex -->
<% if (theme.katex.enable){ %> <% if (theme.katex.enable){ %> <%- partial('katex') %> <% } %>
<%- partial('katex') %>
<% } %>
<!-- busuanzi --> <!-- busuanzi -->
<% if (theme.busuanzi && theme.busuanzi.enable){ %> <% if (theme.busuanzi && theme.busuanzi.enable){ %> <%-
<%- js('/js/busuanzi-2.3.pure.min') %> js('/js/busuanzi-2.3.pure.min') %> <% } %>
<% } %>
<!-- ClickLove --> <!-- ClickLove -->
<% if (theme.click_effect===1){ %> <% if (theme.click_effect===1){ %> <%- js('/js/clickLove') %> <% } %>
<%- js('/js/clickLove') %>
<% } %>
<!-- ClickBoom1 --> <!-- ClickBoom1 -->
<% if (theme.click_effect===2){ %> <% if (theme.click_effect===2){ %>
<script src="https://cdn.jsdelivr.net/npm/animejs@latest/anime.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/animejs@latest/anime.min.js"></script>
<%- js('/js/clickBoom1') %> <%- js('/js/clickBoom1') %> <% } %>
<% } %>
<!-- ClickBoom2 --> <!-- ClickBoom2 -->
<% if (theme.click_effect===3){ %> <% if (theme.click_effect===3){ %> <%- js('/js/clickBoom2') %> <% } %>
<%- js('/js/clickBoom2') %>
<% } %>
<!-- CodeCopy --> <!-- CodeCopy -->
<% if (theme.copy_btn == true) { %> <% if (theme.copy_btn == true) { %> <%- css('/css/clipboard') %> <%-
<%- css('/css/clipboard') %> partial('post/clipboard') %> <% } %>
<%- partial('post/clipboard') %>
<% } %>
<!-- CanvasBackground --> <!-- CanvasBackground -->
<% if (theme.canvas_bg == 1) { %> <% if (theme.canvas_bg == 1) { %> <%- js('/js/dz') %> <% } %>
<%- js('/js/dz') %> <script>
<% } %> if (window.mermaid) {
<!-- mermaid --> mermaid.initialize({ theme: "<%= theme.mermaid.theme %>" });
<% if (theme.mermaid.enable) { %> }
<script src='<%= theme.mermaid.cdn %>/<%= theme.mermaid.version %>/mermaid.min.js'></script> </script>
<script>
if (window.mermaid) {
mermaid.initialize({theme: '<%= theme.mermaid.theme %>'});
}
</script>
<% } %>

View File

@@ -2,40 +2,48 @@
<% if (config.language){ %> <% if (config.language){ %>
<html lang="<%= config.language %>"> <html lang="<%= config.language %>">
<% } else { %> <% } else { %>
<html lang="en"> <html lang="en">
<% }%> <% }%>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<% var title = page.title; if (is_archive()) { title = __('archive_a'); if <% var title = page.title; if (is_archive()) { title = __('archive_a'); if
(is_month()) { title += ': ' + page.year + '/' + page.month; } else if (is_month()) { title += ': ' + page.year + '/' + page.month; } else if
(is_year()) { title += ': ' + page.year; } } else if (is_category()) { title (is_year()) { title += ': ' + page.year; } } else if (is_category()) {
= page.category; } else if (is_tag()) { title = page.category; } else if (is_tag()) { title = __('tag') + ': ' +
title = __('tag') + ': ' + page.tag; } %> <% if (page.keywords){ %> page.tag; } %> <% if (page.keywords){ %>
<meta name="keywords" content="<%= page.keywords %>,<%= config.keywords %>" /> <meta
<% } else if (config.keywords){ %> name="keywords"
<meta name="keywords" content="<%= config.keywords %>" /> content="<%= page.keywords %>,<%= config.keywords %>"
<% } %> <% if (page.description){ %> />
<meta name="description" content="<%= page.description %>" /> <% } else if (config.keywords){ %>
<% } else if (config.description){ %> <meta name="keywords" content="<%= config.keywords %>" />
<meta name="description" content="<%= config.description %>" /> <% } %> <% if (page.description){ %>
<% } %> <meta name="description" content="<%= page.description %>" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> <% } else if (config.description){ %>
<title> <meta name="description" content="<%= config.description %>" />
<% if (title){ %><%= title %> | <% } %> <%= config.title %> <% } %>
</title> <meta
<% if (theme.favicon){ %> name="viewport"
<link rel="shortcut icon" href="<%- theme.favicon %>" /> content="width=device-width, initial-scale=1, maximum-scale=1"
<% } %> />
<%- css('dist/main') %> <title><% if (title){ %><%= title %> | <% } %> <%= config.title %></title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/css/remixicon.min.css"> <% if (theme.favicon){ %>
<%- css('css/custom') %> <link rel="shortcut icon" href="<%- theme.favicon %>" />
<% if (theme.progressBar){ %> <% } %> <%- css('dist/main') %>
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script> <link
<% } %> rel="stylesheet"
<%- partial('google-analytics') %> href="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/css/remixicon.min.css"
<%- partial('baidu-analytics') %> />
</head> <%- css('css/custom') %> <% if (theme.progressBar){ %>
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>
</html> <% } %> <%- partial('google-analytics') %> <%- partial('baidu-analytics')
%>
<!-- mermaid -->
<% if (theme.mermaid.enable) { %>
<script src="<%= theme.mermaid.cdn %>"></script>
<% } %>
</head>
</html>
</html>

View File

@@ -3,75 +3,45 @@
<div id="mvcomments-box"> <div id="mvcomments-box">
<div id="mvcomments"></div> <div id="mvcomments"></div>
</div> </div>
<script src="https://cdn.jsdelivr.net/npm/minivaline@latest"></script> <script src="https://cdn.jsdelivr.net/npm/minivaline@6"></script>
<script> <script>
new MiniValine(Object.assign(<%- JSON.stringify(theme.minivaline) %>, { new MiniValine(Object.assign(<%- JSON.stringify(theme.minivaline) %>, {
el: '#mvcomments', el: '#mvcomments',
})); }));
const infoEle = document.querySelector('#mvcomments .info'); const infoEle = document.querySelector('#mvcomments .info');
if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) { if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
infoEle.childNodes.forEach(function (item) { infoEle.childNodes.forEach(function (item) {
item.parentNode.removeChild(item); item.parentNode.removeChild(item);
}); });
} }
</script> </script>
<style> <style>
#mvcomments-box { #mvcomments-box {
padding: 5px 30px; padding: 5px 30px;
} }
@media screen and (max-width: 800px) { @media screen and (max-width: 800px) {
#mvcomments-box { #mvcomments-box {
padding: 5px 0px; padding: 5px 0px;
} }
} }
.darkmode .MiniValine *{ :root .darkmode {
color: #f1f1f1!important; --ohhho-color-p: #bbb;
} --ohhho-color-text: #fff;
.darkmode .commentTrigger{ --ohhho-color-card: #252d38;
background-color: #403e3e !important; --ohhho-color-block: rgba(68, 68, 68, 0.65);
} --ohhho-expand-before-background: linear-gradient(
.darkmode .MiniValine .vpage .more{ 180deg,
background: #21232F rgba(246, 246, 246, 0),
} rgba(0, 0, 0, 0.9)
.darkmode img{ );
filter: brightness(30%) --ohhho-expand-after-background: rgba(0, 0, 0, 0.9);
} }
.darkmode .MiniValine .vlist .vcard .vcomment-body .text-wrapper .vcomment.expand:before{ .darkmode .ohhho pre {
background: linear-gradient(180deg, rgba(246,246,246,0), rgba(0,0,0,0.9)) background: #888;
} border: 1px solid var(--ohhho-color-block);
.darkmode .MiniValine .vlist .vcard .vcomment-body .text-wrapper .vcomment.expand:after{ }
background: rgba(0,0,0,0.9) .darkmode .ohhho .vlist .vcard .vcomment-body .vhead {
} filter: brightness(85%);
.darkmode .MiniValine .vlist .vcard .vcomment-body .text-wrapper .vcomment pre{ }
background: #282c34
border: 1px solid #282c34
}
.darkmode .MiniValine .vinputs-area .textarea-wrapper textarea{
color: #000;
}
.darkmode .MiniValine .vinputs-area .auth-section .input-wrapper input{
color: #000;
}
.darkmode .MiniValine .vinputs-area .vextra-area .vsmile-icons{
background: transparent;
}
.darkmode .MiniValine .vinputs-wrap{
border-color: #b2b2b5;
}
.darkmode .MiniValine .vinputs-wrap:hover{
border: 1px dashed #2196f3;
}
.darkmode .MiniValine .vinputs-area .auth-section .input-wrapper{
border-bottom: 1px dashed #b2b2b5;
}
.darkmode .MiniValine .vinputs-area .auth-section .input-wrapper:hover{
border-bottom: 1px dashed #2196f3;
}
.darkmode .MiniValine .vbtn{
background-color: transparent!important;
}
.darkmode .MiniValine .vbtn:hover{
border: 1px dashed #2196f3;
}
</style> </style>
<% } %> <% } %>

View File

@@ -1,6 +1,6 @@
{ {
"name": "hexo-theme-ayer", "name": "hexo-theme-ayer",
"version": "1.8.19", "version": "1.8.23",
"description": "a clean and elegant theme for hexo.", "description": "a clean and elegant theme for hexo.",
"scripts": { "scripts": {
"dev": "parcel serve source-src/main.js -d source/dist", "dev": "parcel serve source-src/main.js -d source/dist",

11
scripts/events/index.js Normal file
View File

@@ -0,0 +1,11 @@
/* global hexo */
"use strict";
hexo.on("generateBefore", () => {
require("./lib/merge-configs")(hexo);
});
hexo.on("generateAfter", () => {
require("./lib/hello")(hexo);
});

View File

@@ -0,0 +1,38 @@
"use strict";
module.exports = (hexo) => {
const isZh = hexo.theme.i18n.languages[0].search(/zh-CN/i) !== -1;
if (isZh) {
hexo.log.info(`
------------------------------------------------
| |
| __ ________ _____ |
| /\\\\ \\ / / ____| __ \\ |
| / \\\\ \\_/ /| |__ | |__) | |
| / /\\ \\\\ / | __| | _ / |
| / ____ \\| | | |____| | \\ \\ |
| /_/ \\_\\_| |______|_| \\_\\ |
| |
| 感谢使用 Ayer 主题 ! |
| 文档: https://shen-yu.gitee.io/2019/ayer/ |
| |
------------------------------------------------
`);
} else {
hexo.log.info(`
----------------------------------------------------
| |
| __ ________ _____ |
| /\\\\ \\ / / ____| __ \\ |
| / \\\\ \\_/ /| |__ | |__) | |
| / /\\ \\\\ / | __| | _ / |
| / ____ \\| | | |____| | \\ \\ |
| /_/ \\_\\_| |______|_| \\_\\ |
| |
| Thank you for using Ayer theme ! |
| Docs: https://github.com/Shen-Yu/hexo-theme-ayer |
| |
----------------------------------------------------
`);
}
};

View File

@@ -0,0 +1,28 @@
"use strict";
const objUtil = require("../../utils/object");
const { isNotEmptyObject } = require("../../utils/object");
module.exports = (hexo) => {
const isZh = hexo.theme.i18n.languages[0].search(/zh-CN/i) !== -1;
if (isNotEmptyObject(hexo.config.theme_config)) {
hexo.theme.config = objUtil.merge(
{},
hexo.theme.config,
hexo.config.theme_config
);
if (isZh) {
hexo.log.info("[Ayer] 读取 _config.yml 中 theme_config 配置项覆盖配置");
} else {
hexo.log.info(
"[Ayer] Merge theme config from theme_config in _config.yml"
);
}
}
hexo.log.debug(
"[Ayer] Output theme config:\n",
JSON.stringify(hexo.theme.config, undefined, 2)
);
};

View File

@@ -0,0 +1,12 @@
'use strict';
const joinPath = function(base, relative) {
if (relative && /^https*:\/\//.test(relative)) {
return relative;
}
return relative
? base.replace(/\/+$/, '') + '/' + relative.replace(/^\/+/, '')
: base;
};
module.exports = joinPath;

31
scripts/utils/object.js Normal file
View File

@@ -0,0 +1,31 @@
'use strict';
const isObject = (obj) => {
return obj && typeof obj === 'object' && !Array.isArray(obj);
};
const isNotEmptyObject = (obj) => {
return obj && typeof obj === 'object' && Object.getOwnPropertyNames(obj).length !== 0;
};
const merge = (target, ...sources) => {
for (const source of sources) {
for (const key in source) {
if (!Object.prototype.hasOwnProperty.call(source, key)) {
continue;
}
if (isObject(target[key]) && isObject(source[key])) {
merge(target[key], source[key]);
} else {
target[key] = source[key];
}
}
}
return target;
};
module.exports = {
isObject,
isNotEmptyObject,
merge
};

View File

@@ -56,12 +56,14 @@
color sea color sea
.float_btns .float_btns
position fixed position sticky
bottom 10rem bottom 10rem
right 50px right 50px
z-index 9996 z-index 9996
text-align center text-align center
transform scale(1.2) transform scale(1.2)
width: 50px
float: right
#mask #mask
position fixed position fixed

View File

@@ -14,6 +14,13 @@
opacity .8 opacity .8
background-color body-color background-color body-color
&.nav-main &.nav-main
height 60vh
overflow-y scroll
scrollbar-width none
-ms-overflow-style none
&::-webkit-scrollbar
width 0px
height 0px
.nav-item-link .nav-item-link
i i
font-size 1rem font-size 1rem

File diff suppressed because one or more lines are too long