mm_tpl 2.2.1 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hook.js +1 -1
- package/index.js +7 -7
- package/package.json +1 -1
- package/test.js +0 -1
package/hook.js
CHANGED
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
require('mm_expand');
|
|
2
2
|
const template = require('art-template');
|
|
3
3
|
const Hook = require('./hook.js');
|
|
4
4
|
const {
|
|
@@ -35,8 +35,8 @@ class Tpl {
|
|
|
35
35
|
*/
|
|
36
36
|
this.config = {
|
|
37
37
|
root: $.runPath + '',
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
default_dir: "./template/",
|
|
39
|
+
default_theme: 'default',
|
|
40
40
|
extname: ".html",
|
|
41
41
|
rules: [nativeRule, artRule, htmlRule, jsRule, pyRule, pyRule2],
|
|
42
42
|
cache_root: './cache'.fullname(),
|
|
@@ -64,7 +64,7 @@ class Tpl {
|
|
|
64
64
|
/**
|
|
65
65
|
* 当前主题
|
|
66
66
|
*/
|
|
67
|
-
this.current_theme = this.config.
|
|
67
|
+
this.current_theme = this.config.default_theme;
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* 错误提示
|
|
@@ -248,11 +248,11 @@ Tpl.prototype.view = function(file, model, options) {
|
|
|
248
248
|
}
|
|
249
249
|
var f = file.fullname(this.dir + this.current_theme);
|
|
250
250
|
if (!f.hasFile()) {
|
|
251
|
-
f = file.fullname(this.dir + this.config.
|
|
251
|
+
f = file.fullname(this.dir + this.config.default_theme);
|
|
252
252
|
if (!f.hasFile()) {
|
|
253
|
-
f = file.fullname(this.config.
|
|
253
|
+
f = file.fullname(this.config.default_dir + this.current_theme);
|
|
254
254
|
if (!f.hasFile()) {
|
|
255
|
-
f = file.fullname(this.config.
|
|
255
|
+
f = file.fullname(this.config.default_dir + this.config.default_theme);
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
}
|
package/package.json
CHANGED