Skip to content

Commit

Permalink
update cdn url param
Browse files Browse the repository at this point in the history
  • Loading branch information
Mybrc91 committed Jul 10, 2018
1 parent 6a77b8b commit f91eab8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -10,10 +10,11 @@ Add support of [MathJax](http://www.mathjax.org/) for [Hexo](http://hexo.io/).

## CONFIG

If you want to customize the mathjax js src, Edit `_config.yml`:
If you want to customize the mathjax js src, Edit `_config.yml`,replace cdn url like below:

mathjax:
cdn: your-mathjax-cdn-src
cdn: 'https://cdn.bootcss.com/mathjax/2.7.1/MathJax.js'


## Sample

Expand Down
2 changes: 1 addition & 1 deletion lib/hexo-renderer-mathjax.js
Expand Up @@ -10,7 +10,7 @@ hexo.extend.renderer.register('ejs', 'html', function(data, options) {
var path = options.filename = data.path;
var content = data.text;
if (!isEmpty(hexo.config.mathjax) && !isEmpty(hexo.config.mathjax.cdn)) {
content = content.replace(bodyTag, mathjaxScript +'\n' +'<script src=' + hexo.config.mathjax.cdn + '></script>' +'\n' + bodyTag);
content = content.replace(bodyTag, mathjaxScript +'\n' +'<script src=' + hexo.config.mathjax.cdn + '?config=TeX-AMS-MML_HTMLorMML></script>' +'\n' + bodyTag);
}else{
content = content.replace(bodyTag, mathjaxScript
+'<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>' +'\n' + bodyTag);
Expand Down
10 changes: 5 additions & 5 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "hexo-renderer-mathjax2",
"version": "0.6.1",
"version": "1.1.1",
"description": "MathJax renderer plugin for Hexo",
"main": "index.js",
"scripts": {
Expand All @@ -21,7 +21,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/Mybrc91/hexo-renderer-mathjax.git"
"url": "https://github.com/Mybrc91/hexo-renderer-mathjax2.git"
},
"keywords": [
"math",
Expand All @@ -33,10 +33,10 @@
"name": "Mybrc91",
"email": "Mybrc91@gmail.com"
},
"readme": "https://github.com/Mybrc91/hexo-renderer-mathjax/blob/master/README.md",
"readme": "https://github.com/Mybrc91/hexo-renderer-mathjax2/blob/master/README.md",
"license": "MIT",
"bugs": {
"url": "https://github.com/Mybrc91/hexo-renderer-mathjax/issues"
"url": "https://github.com/Mybrc91/hexo-renderer-mathjax2/issues"
},
"homepage": "https://github.com/Mybrc91/hexo-renderer-mathjax"
"homepage": "https://github.com/Mybrc91/hexo-renderer-mathjax2"
}

0 comments on commit f91eab8

Please sign in to comment.