fixed plugin css files for relative path

v1.18.x
Baris Soner Usakli 11 years ago
parent faf5ea2122
commit d6333a3969

@ -2,6 +2,7 @@ var fs = require('fs'),
path = require('path'),
async = require('async'),
winston = require('winston'),
nconf = require('nconf'),
eventEmitter = require('events').EventEmitter,
db = require('./database');

@ -26,9 +26,12 @@ var nconf = require('nconf'),
// Static Assets
app.get('/plugins/:id/*', function(req, res) {
var relPath = req._parsedUrl.pathname.replace('/plugins/' + req.params.id, '');
var relPath = req._parsedUrl.pathname.replace(nconf.get('relative_path') + '/plugins/' + req.params.id, '');
if (plugins.staticDirs[req.params.id]) {
var fullPath = path.join(plugins.staticDirs[req.params.id], relPath);
fs.exists(fullPath, function(exists) {
if (exists) {
res.sendfile(fullPath, {

@ -94,7 +94,7 @@ if(nconf.get('ssl')) {
}],
templateValues = {
cssSrc: meta.config['theme:src'] || nconf.get('relative_path') + '/vendor/bootstrap/css/bootstrap.min.css',
pluginCSS: plugins.cssFiles.map(function(file) { return { path: file + (meta.config['cache-buster'] ? '?v=' + meta.config['cache-buster'] : '') }; }),
pluginCSS: plugins.cssFiles.map(function(file) { return { path: '/nodebb'+file + (meta.config['cache-buster'] ? '?v=' + meta.config['cache-buster'] : '') }; }),
title: meta.config.title || '',
description: meta.config.description || '',
'brand:logo': meta.config['brand:logo'] || '',

Loading…
Cancel
Save