Index: /CKEditor/branches/prototype/_dev/docs_build/template/publish.js
===================================================================
--- /CKEditor/branches/prototype/_dev/docs_build/template/publish.js	(revision 2883)
+++ /CKEditor/branches/prototype/_dev/docs_build/template/publish.js	(revision 2884)
@@ -3,8 +3,11 @@
 		ext: ".html",
 		outDir: JSDOC.opt.d || SYS.pwd+"../out/jsdoc/",
-		templatesDir: SYS.userDir.replace( /\\/g, '/' ).replace( /\/+$/ ) + '/' + JSDOC.opt.t.replace( /\/+$/, '' ) + '/',
+		templatesDir: JSDOC.opt.t.replace( /\/+$/, '' ) + '/',
 		symbolsDir: "symbols/",
 		srcDir: "symbols/src/"
 	};
+	if (!IO.exists(publish.conf.templatesDir)) {
+		publish.conf.templatesDir = SYS.userDir.replace( /\\/g, '/' ).replace( /\/+$/ ) + '/' + JSDOC.opt.t.replace( /\/+$/, '' ) + '/';
+	}	
 
 	if (JSDOC.opt.s && defined(Link) && Link.prototype._makeSrcLink) {
@@ -121,5 +124,5 @@
 
 	if (!name) {
-		name = path.replace(/\.\.?[\\\/]/g, "").replace(/[\\\/]/g, "_");
+		name = path.replace(/.*\.\.?[\\\/](.*)/g, "$1").replace(/[\\\/]/g, "_");
 		name = name.replace(/\:/g, "_");
 	}
