Release v1.1.2

This commit is contained in:
2026-07-14 21:30:40 +01:00
parent 9f3fcbdaf2
commit b0649d838e
5 changed files with 46 additions and 23 deletions
+3 -2
View File
@@ -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);