mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
allow custom themes to include templates that don't exist in the base theme
This commit is contained in:
@@ -95,10 +95,11 @@ function compileTemplates(pluginTemplates) {
|
||||
themeTpls = !themeTpls ? [] : themeTpls.map(function(tpl) { return tpl.replace(nconf.get('theme_templates_path'), ''); });
|
||||
|
||||
baseTpls.forEach(function(el, i) {
|
||||
var relative_path = (themeTpls.indexOf(el) !== -1 ? themeTpls[themeTpls.indexOf(el)] : baseTpls[i]),
|
||||
full_path = path.join(themeTpls.indexOf(el) !== -1 ? nconf.get('theme_templates_path') : nconf.get('base_templates_path'), relative_path);
|
||||
paths[baseTpls[i]] = path.join(nconf.get('base_templates_path'), baseTpls[i]);
|
||||
});
|
||||
|
||||
paths[themeTpls.indexOf(el) !== -1 ? themeTpls[themeTpls.indexOf(el)] : baseTpls[i]] = full_path;
|
||||
themeTpls.forEach(function(el, i) {
|
||||
paths[themeTpls[i]] = path.join(nconf.get('theme_templates_path'), themeTpls[i]);
|
||||
});
|
||||
|
||||
async.each(Object.keys(paths), function(relative_path, next) {
|
||||
|
||||
Reference in New Issue
Block a user