mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
closes #1235
This commit is contained in:
@@ -106,11 +106,13 @@ function compileTemplates(pluginTemplates) {
|
|||||||
matches = null,
|
matches = null,
|
||||||
regex = /[ \t]*<!-- IMPORT ([\s\S]*?)? -->[ \t]*/;
|
regex = /[ \t]*<!-- IMPORT ([\s\S]*?)? -->[ \t]*/;
|
||||||
|
|
||||||
while (matches = file.match(regex)) {
|
while(matches = file.match(regex)) {
|
||||||
if (paths["/" + matches[1]]) {
|
var partial = "/" + matches[1];
|
||||||
file = file.replace(regex, fs.readFileSync(paths["/" + matches[1]]).toString());
|
|
||||||
|
if (paths[partial] && relative_path !== partial) {
|
||||||
|
file = file.replace(regex, fs.readFileSync(paths[partial]).toString());
|
||||||
} else {
|
} else {
|
||||||
winston.warn('[themes] Partial not found: ' + matches[1]);
|
winston.warn('[themes] Partial not loaded: ' + matches[1]);
|
||||||
file = file.replace(regex, "");
|
file = file.replace(regex, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user