5 Commits

Author SHA1 Message Date
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
shenyu
c61cbb4803 1.8.19 2021-04-14 10:40:23 +08:00
Eric Shen
2e7b792039 Merge pull request #114 from Kiprey/master
添加 mermaid 支持;提高gitalk版本,修复 busuanzi引用span错误
2021-04-14 10:38:14 +08:00
Kiprey
76096640f4 添加 mermaid 支持,提高gitalk版本,修复 busuanzi引用span错误 2021-04-14 09:38:10 +08:00
6 changed files with 87 additions and 82 deletions

View File

@@ -157,6 +157,12 @@ katex:
allpost: true allpost: true
copy_tex: false copy_tex: false
# mermaid流程图 三个选项缺一不可(https://mermaid-js.github.io/mermaid/)
mermaid:
enable: false
cdn: https://cdn.jsdelivr.net/npm/mermaid@8.9.2/dist/mermaid.min.js
theme: forest
# 网站成立年份(默认为 2019若填入年份小于当前年份则显示为 2018-2019 类似的格式) # 网站成立年份(默认为 2019若填入年份小于当前年份则显示为 2018-2019 类似的格式)
since: 2015 since: 2015

View File

@@ -1,66 +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.initialize({ theme: "<%= theme.mermaid.theme %>" });
}
</script>

View File

@@ -2,18 +2,21 @@
<% 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
name="keywords"
content="<%= page.keywords %>,<%= config.keywords %>"
/>
<% } else if (config.keywords){ %> <% } else if (config.keywords){ %>
<meta name="keywords" content="<%= config.keywords %>" /> <meta name="keywords" content="<%= config.keywords %>" />
<% } %> <% if (page.description){ %> <% } %> <% if (page.description){ %>
@@ -21,21 +24,26 @@
<% } else if (config.description){ %> <% } else if (config.description){ %>
<meta name="description" content="<%= config.description %>" /> <meta name="description" content="<%= config.description %>" />
<% } %> <% } %>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> <meta
<title> name="viewport"
<% if (title){ %><%= title %> | <% } %> <%= config.title %> content="width=device-width, initial-scale=1, maximum-scale=1"
</title> />
<title><% if (title){ %><%= title %> | <% } %> <%= config.title %></title>
<% if (theme.favicon){ %> <% if (theme.favicon){ %>
<link rel="shortcut icon" href="<%- theme.favicon %>" /> <link rel="shortcut icon" href="<%- theme.favicon %>" />
<% } %> <% } %> <%- css('dist/main') %>
<%- css('dist/main') %> <link
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/css/remixicon.min.css"> rel="stylesheet"
<%- css('css/custom') %> href="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/css/remixicon.min.css"
<% if (theme.progressBar){ %> />
<%- css('css/custom') %> <% if (theme.progressBar){ %>
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>
<% } %> <%- partial('google-analytics') %> <%- partial('baidu-analytics')
%>
<!-- mermaid -->
<% if (theme.mermaid.enable) { %>
<script src="<%= theme.mermaid.cdn %>"></script>
<% } %> <% } %>
<%- partial('google-analytics') %> </head>
<%- partial('baidu-analytics') %> </html>
</head>
</html> </html>

View File

@@ -1,5 +1,5 @@
<span> <span>
<span><i class="ri-user-3-fill"></i><%- __('site_visitors') %>:<span id="busuanzi_value_site_uv"></span></s> <span><i class="ri-user-3-fill"></i><%- __('site_visitors') %>:<span id="busuanzi_value_site_uv"></span></span>
<span class="division">|</span> <span class="division">|</span>
<span><i class="ri-eye-fill"></i><%- __('page_views') %>:<span id="busuanzi_value_page_pv"></span></span> <span><i class="ri-eye-fill"></i><%- __('page_views') %>:<span id="busuanzi_value_page_pv"></span></span>
</span> </span>

View File

@@ -1,7 +1,7 @@
<% if (theme.gitalk.enable && post.comments) { %> <% if (theme.gitalk.enable && post.comments) { %>
<div class="gitalk" id="gitalk-container"></div> <div class="gitalk" id="gitalk-container"></div>
<%- css('https://cdn.jsdelivr.net/npm/gitalk@1.6.2/dist/gitalk.css') %> <%- css('https://cdn.jsdelivr.net/npm/gitalk@1.7.2/dist/gitalk.css') %>
<%- js('https://cdn.jsdelivr.net/npm/gitalk@1.6.2/dist/gitalk.min.js') %> <%- js('https://cdn.jsdelivr.net/npm/gitalk@1.7.2/dist/gitalk.min.js') %>
<%- js('https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js') %> <%- js('https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js') %>
<script type="text/javascript"> <script type="text/javascript">
var gitalk = new Gitalk({ var gitalk = new Gitalk({

View File

@@ -1,6 +1,6 @@
{ {
"name": "hexo-theme-ayer", "name": "hexo-theme-ayer",
"version": "1.8.18", "version": "1.8.20",
"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",