Comparing version
@@ -84,3 +84,3 @@ // Generated by CoffeeScript 1.6.3 | ||
}); | ||
log.info("Found " + heads.length + " with <head>"); | ||
log.info("Found " + heads.length + " with </body>"); | ||
return typeof callback === "function" ? callback(null, heads) : void 0; | ||
@@ -87,0 +87,0 @@ }); |
// Generated by CoffeeScript 1.6.3 | ||
var Layout, async, escapeRegExp, extend, file, headTag, injectScript, makeLoaderCallback, util; | ||
var Layout, async, escapeRegExp, extend, file, injectScript, injectionPoint, makeLoaderCallback, util; | ||
@@ -12,5 +12,5 @@ extend = hexo.extend; | ||
headTag = "</head>"; | ||
injectionPoint = "</body>"; | ||
injectScript = "<%- partial('math-jax')%>"; | ||
injectScript = "<%- partial('_partial/math-jax')%>"; | ||
@@ -26,3 +26,3 @@ makeLoaderCallback = function(source, callback) { | ||
source.src = src; | ||
source.hasHead = src.indexOf(headTag) >= 0; | ||
source.hasHead = src.indexOf(injectionPoint) >= 0; | ||
source.injected = src.indexOf(injectScript) >= 0; | ||
@@ -52,4 +52,4 @@ return callback(null, source); | ||
var r; | ||
r = new RegExp("" + (escapeRegExp(headTag)), "g"); | ||
return this.src = this.src.replace(r, "" + injectScript + "\n" + headTag); | ||
r = new RegExp("" + (escapeRegExp(injectionPoint)), "g"); | ||
return this.src = this.src.replace(r, "" + injectScript + "\n" + injectionPoint); | ||
}; | ||
@@ -56,0 +56,0 @@ |
{ | ||
"name": "hexo-math", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Add MathJax support to hexo", | ||
@@ -5,0 +5,0 @@ "main": "./bin/index", |
@@ -10,2 +10,16 @@ hexo-math | ||
(See a Chinese version of this document [here](http://blog.catx.me/2014/03/09/hexo-mathjax-plugin/)) | ||
## Migration Note | ||
### From 1.0.3 and before | ||
Since 1.0.4, MathJax scripts will be injected in `<body>` section instead of `<head>` section. | ||
Before you update `hexo-math` to newer version, you should run: | ||
> $ hexo math uninstall | ||
After `hexo-math` is updated, run install again: | ||
> $ hexo math install | ||
## Install | ||
@@ -64,3 +78,1 @@ | ||
``` | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
51281
0.54%77
18.46%