@_tc/template-core 0.0.1-bate.19 → 0.0.1-bate.20
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.
|
@@ -7,7 +7,8 @@ const paths_1 = require("../../packages/core/paths");
|
|
|
7
7
|
const nunjucks_1 = __importDefault(require("nunjucks"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
exports.default = (app) => {
|
|
10
|
-
const viewsPath = path_1.default.join((0, paths_1.getAppPath)(app,
|
|
10
|
+
const viewsPath = path_1.default.join((0, paths_1.getAppPath)(app, "frame"), "./public");
|
|
11
|
+
console.log(viewsPath);
|
|
11
12
|
const env = nunjucks_1.default.configure(viewsPath, {
|
|
12
13
|
autoescape: true,
|
|
13
14
|
throwOnUndefined: false,
|
|
@@ -18,6 +19,10 @@ exports.default = (app) => {
|
|
|
18
19
|
});
|
|
19
20
|
app.extends.nunjucksEnv = env;
|
|
20
21
|
return (view, ctx, context) => {
|
|
22
|
+
console.log("view ---- >", view);
|
|
23
|
+
console.log(env.options);
|
|
24
|
+
console.log(env.opts);
|
|
25
|
+
console.log(env.loaders[0]);
|
|
21
26
|
ctx.body = env.render(view, Object.assign({}, ctx.state, context));
|
|
22
27
|
};
|
|
23
28
|
};
|
|
@@ -2,7 +2,8 @@ import { getAppPath } from "../../packages/core/paths";
|
|
|
2
2
|
import nunjucks from "nunjucks";
|
|
3
3
|
import path from "path";
|
|
4
4
|
export default (app) => {
|
|
5
|
-
const viewsPath = path.join(getAppPath(app,
|
|
5
|
+
const viewsPath = path.join(getAppPath(app, "frame"), "./public");
|
|
6
|
+
console.log(viewsPath);
|
|
6
7
|
const env = nunjucks.configure(viewsPath, {
|
|
7
8
|
autoescape: true,
|
|
8
9
|
throwOnUndefined: false,
|
|
@@ -13,6 +14,10 @@ export default (app) => {
|
|
|
13
14
|
});
|
|
14
15
|
app.extends.nunjucksEnv = env;
|
|
15
16
|
return (view, ctx, context) => {
|
|
17
|
+
console.log("view ---- >", view);
|
|
18
|
+
console.log(env.options);
|
|
19
|
+
console.log(env.opts);
|
|
20
|
+
console.log(env.loaders[0]);
|
|
16
21
|
ctx.body = env.render(view, Object.assign({}, ctx.state, context));
|
|
17
22
|
};
|
|
18
23
|
};
|