v1.18.x
psychobunny 10 years ago
parent 0b58e2fea3
commit c905f96108

@ -27,7 +27,17 @@ Templates.compile = function(callback) {
var coreTemplatesPath = nconf.get('core_templates_path'),
baseTemplatesPath = nconf.get('base_templates_path'),
viewsPath = nconf.get('views_dir'),
themeTemplatesPath = nconf.get('theme_templates_path');
themeTemplatesPath = nconf.get('theme_templates_path'),
themeConfig = require(nconf.get('theme_config'));
if (themeConfig.baseTheme) {
var pathToBaseTheme = path.join(nconf.get('themes_path'), themeConfig.baseTheme),
baseTemplatesPath = require(path.join(pathToBaseTheme, 'theme.json')).templates;
if (!baseTemplatesPath){
baseTemplatesPath = path.join(pathToBaseTheme, 'templates');
}
}
plugins.getTemplates(function(err, pluginTemplates) {
if (err) {

@ -111,6 +111,7 @@ module.exports = function(Meta) {
// 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)) {
@ -118,5 +119,6 @@ module.exports = function(Meta) {
}
nconf.set('theme_templates_path', themePath);
nconf.set('theme_config', path.join(nconf.get('themes_path'), themeObj.id, 'theme.json'));
};
};
Loading…
Cancel
Save