mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
Don't track file information for externally loaded tiddlers
This commit is contained in:
parent
e8746c1575
commit
b574436dff
20
core/boot.js
20
core/boot.js
@ -915,7 +915,7 @@ $tw.loadTiddlersFromFile = function(filepath,fields) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Load all the tiddlers recursively from a directory, including honouring `tiddlywiki.files` files for drawing in external files. Returns an array of {filepath:,type:,tiddlers: [{..fields...}],hasMetaFile:}
|
Load all the tiddlers recursively from a directory, including honouring `tiddlywiki.files` files for drawing in external files. Returns an array of {filepath:,type:,tiddlers: [{..fields...}],hasMetaFile:}. Note that no file information is returned for externally loaded tiddlers, just the `tiddlers` property.
|
||||||
*/
|
*/
|
||||||
$tw.loadTiddlersFromPath = function(filepath,excludeRegExp) {
|
$tw.loadTiddlersFromPath = function(filepath,excludeRegExp) {
|
||||||
excludeRegExp = excludeRegExp || /^\.DS_Store$|.meta$/;
|
excludeRegExp = excludeRegExp || /^\.DS_Store$|.meta$/;
|
||||||
@ -933,7 +933,7 @@ $tw.loadTiddlersFromPath = function(filepath,excludeRegExp) {
|
|||||||
pathname = path.resolve(filepath,tidInfo.file),
|
pathname = path.resolve(filepath,tidInfo.file),
|
||||||
text = fs.readFileSync(pathname,typeInfo ? typeInfo.encoding : "utf8");
|
text = fs.readFileSync(pathname,typeInfo ? typeInfo.encoding : "utf8");
|
||||||
tidInfo.fields.text = text;
|
tidInfo.fields.text = text;
|
||||||
tiddlers.push({filepath: pathname, tiddlers: tidInfo.fields});
|
tiddlers.push({tiddlers: tidInfo.fields});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// If not, read all the files in the directory
|
// If not, read all the files in the directory
|
||||||
@ -1003,13 +1003,15 @@ $tw.loadTiddlers = function() {
|
|||||||
var wikiTiddlersPath = path.resolve($tw.boot.wikiPath,$tw.config.wikiTiddlersSubDir);
|
var wikiTiddlersPath = path.resolve($tw.boot.wikiPath,$tw.config.wikiTiddlersSubDir);
|
||||||
$tw.utils.each($tw.loadTiddlersFromPath(wikiTiddlersPath),function(tiddlerFile) {
|
$tw.utils.each($tw.loadTiddlersFromPath(wikiTiddlersPath),function(tiddlerFile) {
|
||||||
$tw.wiki.addTiddlers(tiddlerFile.tiddlers);
|
$tw.wiki.addTiddlers(tiddlerFile.tiddlers);
|
||||||
$tw.utils.each(tiddlerFile.tiddlers,function(tiddler) {
|
if(tiddlerFile.filepath) {
|
||||||
$tw.boot.files[tiddler.title] = {
|
$tw.utils.each(tiddlerFile.tiddlers,function(tiddler) {
|
||||||
filepath: tiddlerFile.filepath,
|
$tw.boot.files[tiddler.title] = {
|
||||||
type: tiddlerFile.type,
|
filepath: tiddlerFile.filepath,
|
||||||
hasMetaFile: tiddlerFile.hasMetaFile
|
type: tiddlerFile.type,
|
||||||
};
|
hasMetaFile: tiddlerFile.hasMetaFile
|
||||||
});
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
// Load any plugins listed in the wiki info file
|
// Load any plugins listed in the wiki info file
|
||||||
var wikiInfoPath = path.resolve($tw.boot.wikiPath,$tw.config.wikiInfo),
|
var wikiInfoPath = path.resolve($tw.boot.wikiPath,$tw.config.wikiInfo),
|
||||||
|
Loading…
Reference in New Issue
Block a user