mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 00:10:25 +01:00
removing "pluginCSS", "css" in plugins is now included directly into stylesheet.css. This is a breaking change.
fixes #1168
This commit is contained in:
@@ -11,9 +11,6 @@
|
||||
<!-- BEGIN linkTags -->
|
||||
<link<!-- IF linkTags.link --> link="{linkTags.link}"<!-- ENDIF linkTags.link --><!-- IF linkTags.rel --> rel="{linkTags.rel}"<!-- ENDIF linkTags.rel --><!-- IF linkTags.type --> type="{linkTags.type}"<!-- ENDIF linkTags.type --><!-- IF linkTags.href --> href="{linkTags.href}"<!-- ENDIF linkTags.href --> />
|
||||
<!-- END linkTags -->
|
||||
<!-- BEGIN pluginCSS -->
|
||||
<link rel="stylesheet" href="{pluginCSS.path}?{cache-buster}">
|
||||
<!-- END pluginCSS -->
|
||||
<!-- IF useCustomCSS -->
|
||||
<style type="text/css">{customCSS}</style>
|
||||
<!-- ENDIF useCustomCSS -->
|
||||
|
||||
@@ -62,6 +62,8 @@ var fs = require('fs'),
|
||||
Plugins.loadedHooks = {};
|
||||
Plugins.staticDirs = {};
|
||||
Plugins.cssFiles.length = 0;
|
||||
Plugins.lessFiles.length = 0;
|
||||
Plugins.clientScripts.length = 0;
|
||||
|
||||
// Read the list of activated plugins and require their libraries
|
||||
async.waterfall([
|
||||
@@ -195,21 +197,12 @@ var fs = require('fs'),
|
||||
winston.info('[plugins] Found ' + pluginData.css.length + ' CSS file(s) for plugin ' + pluginData.id);
|
||||
}
|
||||
|
||||
if (!pluginData.staticDir) {
|
||||
Plugins.cssFiles = Plugins.cssFiles.concat(pluginData.css.map(function(file) {
|
||||
return path.join('/plugins', file);
|
||||
}));
|
||||
} else {
|
||||
winston.warn('[plugins/' + pluginData.id + '] staticDir is deprecated, define CSS files with new staticDirs instead.');
|
||||
Plugins.cssFiles = Plugins.cssFiles.concat(pluginData.css.map(function(file) {
|
||||
return path.join('/plugins', pluginData.id, file);
|
||||
return path.join(pluginData.id, file);
|
||||
}));
|
||||
}
|
||||
|
||||
next();
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
},
|
||||
function(next) {
|
||||
// LESS files for plugins
|
||||
|
||||
@@ -26,6 +26,11 @@ var path = require('path'),
|
||||
source += '\n@import "./' + plugins.lessFiles[x] + '";';
|
||||
}
|
||||
|
||||
// ... and for each CSS file
|
||||
for(x=0,numCSS=plugins.cssFiles.length;x<numCSS;x++) {
|
||||
source += '\n@import (less) "./' + plugins.cssFiles[x] + '";';
|
||||
}
|
||||
|
||||
var parser = new (less.Parser)({
|
||||
paths: paths
|
||||
});
|
||||
|
||||
@@ -123,7 +123,6 @@ process.on('uncaughtException', function(err) {
|
||||
}],
|
||||
templateValues = {
|
||||
bootswatchCSS: meta.config['theme:src'],
|
||||
pluginCSS: plugins.cssFiles.map(function(file) { return { path: nconf.get('relative_path') + file.replace(/\\/g, '/') }; }),
|
||||
title: meta.config.title || '',
|
||||
description: meta.config.description || '',
|
||||
'brand:logo': meta.config['brand:logo'] || '',
|
||||
|
||||
Reference in New Issue
Block a user