1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-28 19:10:28 +00:00

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

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:}