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