mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 00:06:33 +02:00
up'ing templates.js
This commit is contained in:
@@ -92,6 +92,9 @@ module.exports = function(Meta) {
|
||||
themeData['theme:src'] = '';
|
||||
|
||||
db.setObject('config', themeData, next);
|
||||
|
||||
// Re-set the themes path (for when NodeBB is reloaded)
|
||||
Meta.themes.setPath(config);
|
||||
}
|
||||
], callback);
|
||||
|
||||
@@ -104,4 +107,17 @@ module.exports = function(Meta) {
|
||||
}
|
||||
};
|
||||
|
||||
Meta.themes.setPath = function(themeObj) {
|
||||
console.log(themeObj);
|
||||
// Theme's templates path
|
||||
var themePath = nconf.get('base_templates_path'),
|
||||
fallback = path.join(nconf.get('themes_path'), themeObj.id, 'templates');
|
||||
if (themeObj.templates) {
|
||||
themePath = path.join(nconf.get('themes_path'), themeObj.id, themeObj.templates);
|
||||
} else if (fs.existsSync(fallback)) {
|
||||
themePath = fallback;
|
||||
}
|
||||
|
||||
nconf.set('theme_templates_path', themePath);
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user