Browse Source

fix set hexo root dir fail

zhuzhuyule 7 years ago
parent
commit
bbd51406b8
2 changed files with 3 additions and 1 deletions
  1. 2 0
      views/main/hexo/hexo.js
  2. 1 1
      views/main/hexo/previewer.js

+ 2 - 0
views/main/hexo/hexo.js

@@ -23,6 +23,7 @@ function Hexo() {
     this.render = new Render(this);
     this.render = new Render(this);
     this.loadConfig();
     this.loadConfig();
     moeApp.config.set('hexo-root-dir',this.config.__basedir);
     moeApp.config.set('hexo-root-dir',this.config.__basedir);
+    moeApp.setHexo(this);
 }
 }
 
 
 Hexo.prototype.init = function() {
 Hexo.prototype.init = function() {
@@ -100,6 +101,7 @@ Hexo.prototype.changeConfig = function (enable) {
         // Load tags file
         // Load tags file
         this.loadTags();
         this.loadTags();
     }
     }
+    moeApp.setHexo(hexo);
 }
 }
 
 
 module.exports = Hexo;
 module.exports = Hexo;

+ 1 - 1
views/main/hexo/previewer.js

@@ -16,7 +16,7 @@ var rPlaceholder = /(?:<|&lt;)\!--\uFFFC(\d+)--(?:>|&gt;)/g;
 
 
 global.lodash = require('lodash');
 global.lodash = require('lodash');
 global.ctx = global.hexo = new Hexo();
 global.ctx = global.hexo = new Hexo();
-moeApp.setHexo(hexo);
+
 
 
 function Previewer() {
 function Previewer() {
 }
 }