Allow wiki folders to contain a themes folder

This commit is contained in:
Jeremy Ruston 2013-07-14 23:08:04 +01:00
parent 5e93778112
commit 4655a7a4d7
1 changed files with 12 additions and 0 deletions

View File

@ -1244,6 +1244,17 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
}
}
}
// Load any themes within the wiki folder
var wikiThemesPath = path.resolve(wikiPath,$tw.config.wikiThemesSubDir);
if(fs.existsSync(wikiThemesPath)) {
var themeFolders = fs.readdirSync(wikiThemesPath);
for(t=0; t<themeFolders.length; t++) {
pluginFields = $tw.loadPluginFolder(path.resolve(wikiThemesPath,"./" + themeFolders[t]));
if(pluginFields) {
$tw.wiki.addTiddler(pluginFields);
}
}
}
return wikiInfo;
};
@ -1275,6 +1286,7 @@ $tw.boot.startup = function() {
themesPath: "../themes/",
wikiInfo: "./tiddlywiki.info",
wikiPluginsSubDir: "./plugins",
wikiThemesSubDir: "./themes",
wikiTiddlersSubDir: "./tiddlers",
jsModuleHeaderRegExpString: "^\\/\\*\\\\(?:\\r?\\n)((?:^[^\\r\\n]*(?:\\r?\\n))+?)(^\\\\\\*\\/$(?:\\r?\\n)?)",
fileExtensionInfo: {}, // Map file extension to {type:}