From f91eab8b9f79f6c462f5e6fd013f9d004dc387ec Mon Sep 17 00:00:00 2001 From: Mybrc91 Date: Tue, 10 Jul 2018 15:34:01 +0800 Subject: [PATCH] update cdn url param --- README.md | 5 +++-- lib/hexo-renderer-mathjax.js | 2 +- package.json | 10 +++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 90c88d3..ba954b6 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/lib/hexo-renderer-mathjax.js b/lib/hexo-renderer-mathjax.js index fef2243..7afea8e 100644 --- a/lib/hexo-renderer-mathjax.js +++ b/lib/hexo-renderer-mathjax.js @@ -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' +'' +'\n' + bodyTag); + content = content.replace(bodyTag, mathjaxScript +'\n' +'' +'\n' + bodyTag); }else{ content = content.replace(bodyTag, mathjaxScript +'' +'\n' + bodyTag); diff --git a/package.json b/package.json index cb0f6d9..94b5e0e 100644 --- a/package.json +++ b/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": { @@ -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", @@ -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" }