module.exports = {
  book: {
    assets: ".",
    js: [
    ],
    html: {
      "head:end": function(cur, b) {
        var config = this.options.pluginsConfig.customtheme || {js:[], css:[]};
        var updateElements;
        updateElements = '';
        var getPathHierarchy = function() {
          var temp = '';
          if (!cur._input) {
            return temp;
          }
          var depth = cur._input.split('/');
          for (var i = 0; i < depth.length - 1; i++) {
            temp += '../';
          }
          return temp;
        };
        var resolvePath = function(fileName) {
          var temp = fileName.replace('../', '');
          return  getPathHierarchy() + temp;
        };
        if (config.options && config.options.ignoreChooseLang && !cur._input && cur.langs) {
          	return updateElements;
        }
        if (config.js && config.js.length > 0) {
          for (var i in config.js) {
            updateElements += '<script type="text/javascript" src="' + resolvePath(config.js[i]) + '"></script>';
          }
        }
        if (config.css && config.css.length > 0) {
          var temp;
          for (var i in config.css) {
            temp = config.css[i].replace('../', '');
            updateElements += '<link rel="stylesheet" type="text/css" href="' + resolvePath(temp) +'">';
          }
        }
        return updateElements;
      }
    }
  }
};

@@ -922,24 +922,73 @@
 onfig.js) %7B%0A
+            if (config.js.hasOwnProperty(i)) %7B%0A  
             
@@ -1085,24 +1085,38 @@
 %3C/script%3E';%0A
+            %7D%0A
           %7D%0A
@@ -1230,24 +1230,74 @@
 nfig.css) %7B%0A
+            if (config.css.hasOwnProperty(i)) %7B%0A  
             
@@ -1329,32 +1329,34 @@
 ace('../', '');%0A
+  
             upda
@@ -1440,24 +1440,38 @@
 emp) +'%22%3E';%0A
+            %7D%0A
           %7D%0A

Fix keys in loops