Remove unnecesary admin search indexing

v1.18.x
Peter Jaszkowiak 8 years ago
parent 240e958fb1
commit fd4d53e42c

@ -12,7 +12,6 @@ var plugins = require('../plugins');
var utils = require('../../public/src/utils'); var utils = require('../../public/src/utils');
var Templates = {}; var Templates = {};
var searchIndex = {};
Templates.compile = function (callback) { Templates.compile = function (callback) {
callback = callback || function () {}; callback = callback || function () {};
@ -131,10 +130,6 @@ function compile(callback) {
} }
} }
if (relativePath.match(/^\/admin\/[\s\S]*?/)) {
addIndex(relativePath, file);
}
mkdirp.sync(path.join(viewsPath, relativePath.split('/').slice(0, -1).join('/'))); mkdirp.sync(path.join(viewsPath, relativePath.split('/').slice(0, -1).join('/')));
fs.writeFile(path.join(viewsPath, relativePath), file, next); fs.writeFile(path.join(viewsPath, relativePath), file, next);
}, function (err) { }, function (err) {
@ -143,25 +138,11 @@ function compile(callback) {
return callback(err); return callback(err);
} }
compileIndex(viewsPath, function (err) { winston.verbose('[meta/templates] Successfully compiled templates.');
if (err) {
return callback(err);
}
winston.verbose('[meta/templates] Successfully compiled templates.');
callback(); callback();
});
}); });
}); });
} }
function addIndex(path, file) {
searchIndex[path] = file;
}
function compileIndex(viewsPath, callback) {
fs.writeFile(path.join(viewsPath, '/indexed.json'), JSON.stringify(searchIndex), callback);
}
module.exports = Templates; module.exports = Templates;
Loading…
Cancel
Save