✨ feat: Katex support
This commit is contained in:
parent
b07d7c7ec7
commit
9ee2605a49
@ -207,9 +207,15 @@ google_analytics: ''
|
|||||||
# Baidu Analytics
|
# Baidu Analytics
|
||||||
baidu_analytics: ''
|
baidu_analytics: ''
|
||||||
|
|
||||||
# mathjax
|
# Mathjax Support
|
||||||
mathjax: true
|
mathjax: true
|
||||||
|
|
||||||
|
# Katex Support
|
||||||
|
katex:
|
||||||
|
enable: false # true
|
||||||
|
allpost: true
|
||||||
|
copy_tex: false
|
||||||
|
|
||||||
# since year
|
# since year
|
||||||
since: 2019
|
since: 2019
|
||||||
|
|
||||||
|
@ -153,9 +153,15 @@ google_analytics: ''
|
|||||||
# 百度统计
|
# 百度统计
|
||||||
baidu_analytics: ''
|
baidu_analytics: ''
|
||||||
|
|
||||||
# 数学公式
|
# Mathjax数学公式
|
||||||
mathjax: false
|
mathjax: false
|
||||||
|
|
||||||
|
# Katex数学公式(allpost设置为false时只有头部设置math:true的文章才开启)
|
||||||
|
katex:
|
||||||
|
enable: false # true
|
||||||
|
allpost: true
|
||||||
|
copy_tex: false
|
||||||
|
|
||||||
# 网站成立年份(默认为 2019,若填入年份小于当前年份,则显示为 2018-2019 类似的格式)
|
# 网站成立年份(默认为 2019,若填入年份小于当前年份,则显示为 2018-2019 类似的格式)
|
||||||
since: 2015
|
since: 2015
|
||||||
|
|
||||||
|
@ -52,11 +52,14 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
<% if (theme.katex.enable){ %>
|
||||||
|
<%- partial('katex') %>
|
||||||
|
<% } %>
|
||||||
<% 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') %>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<script type="text/javascript" src="https://js.users.51.la/20544303.js"></script>
|
<script type="text/javascript" src="https://js.users.51.la/20544303.js"></script>
|
||||||
<% if (theme.clickLove){ %>
|
<% if (theme.clickLove){ %>
|
||||||
<script src="<%- url_for('js/clickLove.js') %>"></script>
|
<%- js('/js/clickLove') %>
|
||||||
<% } %>
|
<% } %>
|
11
layout/_partial/katex.ejs
Normal file
11
layout/_partial/katex.ejs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<% if ( theme.katex.enable ) { %>
|
||||||
|
<% if( theme.katex.allpost || page.math ) { %>
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css">
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js"></script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js"></script>
|
||||||
|
<% if ( theme.katex.copy_tex ) { %>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/copy-tex.min.js"></script>
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/copy-tex.min.css">
|
||||||
|
<% } %>
|
||||||
|
<% } %>
|
||||||
|
<% } %>
|
Loading…
Reference in New Issue
Block a user