Merge pull request #114 from Kiprey/master

添加 mermaid 支持;提高gitalk版本,修复 busuanzi引用span错误
This commit is contained in:
Eric Shen 2021-04-14 10:38:14 +08:00 committed by GitHub
commit 2e7b792039
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 3 deletions

View File

@ -157,6 +157,13 @@ katex:
allpost: true allpost: true
copy_tex: false copy_tex: false
# mermaid 三个选项缺一不可
mermaid:
enable: true
version: 8.5.2
cdn: https://cdn.bootcdn.net/ajax/libs/mermaid
theme: forest
# 网站成立年份(默认为 2019若填入年份小于当前年份则显示为 2018-2019 类似的格式) # 网站成立年份(默认为 2019若填入年份小于当前年份则显示为 2018-2019 类似的格式)
since: 2015 since: 2015

View File

@ -64,3 +64,12 @@
<% if (theme.canvas_bg == 1) { %> <% if (theme.canvas_bg == 1) { %>
<%- js('/js/dz') %> <%- js('/js/dz') %>
<% } %> <% } %>
<!-- mermaid -->
<% if (theme.mermaid.enable) { %>
<script src='<%= theme.mermaid.cdn %>/<%= theme.mermaid.version %>/mermaid.min.js'></script>
<script>
if (window.mermaid) {
mermaid.initialize({theme: '<%= theme.mermaid.theme %>'});
}
</script>
<% } %>

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({