|
|
|
@ -16,7 +16,7 @@ var path = require('path'),
|
|
|
|
|
|
|
|
|
|
db.getObjectFields('config', ['theme:type', 'theme:id'], function(err, themeData) {
|
|
|
|
|
var themeId = (themeData['theme:id'] || 'nodebb-theme-vanilla'),
|
|
|
|
|
baseThemePath = path.join(nconf.get('themes_path'), themeId),
|
|
|
|
|
baseThemePath = path.join(nconf.get('themes_path'), (themeData['theme:type'] && themeData['theme:type'] === 'local' ? themeId : 'nodebb-theme-vanilla')),
|
|
|
|
|
paths = [baseThemePath, path.join(__dirname, '../../node_modules')],
|
|
|
|
|
source = '@import "./theme";',
|
|
|
|
|
x, numLESS;
|
|
|
|
@ -26,9 +26,6 @@ var path = require('path'),
|
|
|
|
|
source += '\n@import "./' + plugins.lessFiles[x] + '";';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Detect if a theme has been selected, and handle appropriately
|
|
|
|
|
if (!themeData['theme:type'] || themeData['theme:type'] === 'local') {
|
|
|
|
|
// Local theme
|
|
|
|
|
var parser = new (less.Parser)({
|
|
|
|
|
paths: paths
|
|
|
|
|
});
|
|
|
|
@ -44,10 +41,6 @@ var path = require('path'),
|
|
|
|
|
});
|
|
|
|
|
res.type('text/css').send(200, meta.css.cache);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
// Bootswatch theme not supported yet
|
|
|
|
|
res.send(500, 'Give me time!');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|