Skip to content

Commit

Permalink
添加启用数学公式
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin committed Mar 1, 2020
1 parent 81affec commit df61e84
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Expand Up @@ -137,7 +137,37 @@ leancloud_visitors:
app_id:
app_key:
```
## 启用数学公式

卸载`hexo-renderer-marked`,替换为`hexo-renderer-markdown-it-plus`

``` bash
npm un hexo-renderer-marked --save
npm i hexo-renderer-markdown-it-plus --save
```

在需要启用数学公式的博客的head添加math: true

编辑站点的配置文件

``` yaml
# hexo/_config.yml
markdown_it_plus:
highlight: true
html: true
xhtmlOut: true
breaks: true
langPrefix:
linkify: true
typographer:
quotes: “”‘’
pre_class: highlight
```



## 自定义代码高亮

`hexo-theme-shana\source\css_partial\highlight.styl`

![](https://user-images.githubusercontent.com/20333903/28317264-c8a80a28-6bf8-11e7-88f9-f1ef542f5118.png)
Expand Down
1 change: 1 addition & 0 deletions layout/_partial/head.ejs
Expand Up @@ -34,4 +34,5 @@
<%- css('css/style') %>
<%- css('plugin/bganimation/bg') %>
<%- partial('google-analytics') %>
<link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.css" rel="stylesheet" type="text/css">
</head>

0 comments on commit df61e84

Please sign in to comment.