Skip to content

Commit deb8c53

Browse files
committed
add mathjsx support
1 parent 22696d1 commit deb8c53

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed

_config.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ widgets:
3939
- category
4040
- tagcloud
4141
- recent_posts
42-
- lastest_comments
43-
- hot_comment_posts
4442
- archive
4543
- friendly_link
4644

@@ -70,6 +68,15 @@ show_count: true
7068
# 如果启动,则标签云颜色为随机
7169
tagcloud_color: false
7270

71+
# MathJax Support
72+
# 设置enable属性为true即可开启mathjax
73+
# per_page如果为true表示所有文章都设置支持mathjax,如果为false,则在需要支持mathjax的文章加上mathjax: true
74+
mathjax:
75+
enable: true
76+
per_page: false
77+
cdn: //cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
78+
79+
7380

7481
# 其他参数
7582
google_analytics:
@@ -79,7 +86,8 @@ favicon: /favicon.png
7986
# 关闭统一为 false
8087
# 若使用多说,此处填写的是多说评论账号ID
8188
## 网易云跟帖
82-
gentie_productKey: e2fb4051c49842688ce669e634bc983f
89+
### 使用说明 http://cafe.giscafer.com/2017/04/14/gentie-test/
90+
gentie_productKey: e2fb4051c49xxx8ce669e634bc983f
8391
## 多说 (2017年6月将关闭)
8492
duoshuo_shortname: false
8593
## disqus

layout/_third-part/index.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
<% include ./comments/index.ejs %>
1+
<% include ./comments/index.ejs %>
2+
<% include ./mathjax/index.ejs %>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<% if (theme.mathjax.enable) {%>
2+
<% if (!theme.mathjax.per_page || (page.total || page.mathjax)) {%>
3+
<script type="text/x-mathjax-config">
4+
MathJax.Hub.Config({
5+
tex2jax: {
6+
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
7+
processEscapes: true,
8+
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
9+
}
10+
})
11+
</script>
12+
13+
<script type="text/x-mathjax-config">
14+
MathJax.Hub.Queue(function() {
15+
var all = MathJax.Hub.getAllJax(), i;
16+
for (i=0; i < all.length; i += 1) {
17+
all[i].SourceElement().parentNode.className += ' has-jax';
18+
}
19+
})
20+
</script>
21+
<script type="text/javascript" src="<%= theme.mathjax.cdn %>"></script>
22+
<% } %>
23+
<% } %>

0 commit comments

Comments
 (0)