Release v1.1.2
This commit is contained in:
+3
-2
@@ -1,6 +1,7 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const Handlebars = require('handlebars');
|
||||
const { version: appVersion } = require('../../package.json');
|
||||
|
||||
const VIEWS_ROOT = path.join(__dirname, 'views');
|
||||
const cache = new Map();
|
||||
@@ -47,7 +48,7 @@ function loadTemplate(relativePath) {
|
||||
}
|
||||
|
||||
function renderView(viewName, context) {
|
||||
const viewContext = Object.assign({ stylesheets: [], scripts: [] }, context || {});
|
||||
const viewContext = Object.assign({ stylesheets: [], scripts: [], appVersion: appVersion }, context || {});
|
||||
const page = loadTemplate(`${viewName}.hbs`);
|
||||
const layout = loadTemplate(path.join('layout.hbs'));
|
||||
const body = page(viewContext);
|
||||
@@ -55,7 +56,7 @@ function renderView(viewName, context) {
|
||||
}
|
||||
|
||||
function renderFragment(viewName, context) {
|
||||
const viewContext = Object.assign({ stylesheets: [], scripts: [] }, context || {});
|
||||
const viewContext = Object.assign({ stylesheets: [], scripts: [], appVersion: appVersion }, context || {});
|
||||
const page = loadTemplate(`${viewName}.hbs`);
|
||||
const layout = loadTemplate(path.join('frame-layout.hbs'));
|
||||
const body = page(viewContext);
|
||||
|
||||
Reference in New Issue
Block a user