@@ -58,7 +58,7 @@ const openUrl = async (url: string) => {
58
58
// Publish list of files
59
59
export const publishFiles = async (
60
60
client : RemoteClient ,
61
- vault : any ,
61
+ app : any ,
62
62
pathList : string [ ] ,
63
63
allFiles : TFile [ ] ,
64
64
password : string = "" ,
@@ -67,6 +67,7 @@ export const publishFiles = async (
67
67
view ?: StatsView ,
68
68
cb ?: ( key : string , status : 'START' | 'DONE' | 'FAIL' , meta ?: any ) => any ,
69
69
) => {
70
+ const vault = app . vault ;
70
71
const htmlPath = AssetHandler . initHtmlPath ( ) ;
71
72
72
73
if ( allFiles . length > 100000 || allFiles . length < 0 )
@@ -123,9 +124,23 @@ export const publishFiles = async (
123
124
path : `${ sitemapDownload . relativeDownloadPath . asString } /${ sitemapDownload . filename } ` ,
124
125
key : settings . localWatchDir + '/' + sitemapDownload . filename ,
125
126
} )
126
- log . info ( 'sitemap - ' , sitemapDomStr , htmlPath ) ;
127
+ log . info ( 'generating sitemap...' ) ;
127
128
externalFiles . push ( sitemapDownload ) ;
128
129
}
130
+ // metadataCache
131
+ const filesMetadata : any = { } ;
132
+ allFiles . forEach ( file => {
133
+ filesMetadata [ file . path ] = app . metadataCache . getFileCache ( file )
134
+ } ) ;
135
+
136
+ const metaDownload = new Downloadable ( 'meta.json' , JSON . stringify ( filesMetadata ) , htmlPath . joinString ( settings . localWatchDir ) ) ;
137
+ Object . assign ( metaDownload , {
138
+ path : `${ metaDownload . relativeDownloadPath . asString } /${ metaDownload . filename } ` ,
139
+ key : settings . localWatchDir + '/' + metaDownload . filename ,
140
+ } )
141
+ log . info ( 'generating meta...' ) ;
142
+ externalFiles . push ( metaDownload ) ;
143
+
129
144
externalFiles = externalFiles . filter ( ( file , index ) => externalFiles . findIndex ( ( f ) => f . relativeDownloadPath == file . relativeDownloadPath && f . filename === file . filename ) == index ) ;
130
145
await Utils . downloadFiles ( externalFiles , htmlPath , view ) ;
131
146
log . info ( 'download files to: ' , htmlPath , externalFiles ) ;
0 commit comments