@@ -25,14 +25,15 @@ SOFTWARE.
25
25
*/
26
26
27
27
const _just = { } ;
28
- const [ HTMLtemplate , CSStemplate , JStemplate , PATH , repo , owner ] = process . argv . slice ( 2 ) ;
28
+ const [ HTMLtemplate , CSStemplate , JStemplate , PATH , repo , owner , customCSS ] = process . argv . slice ( 2 ) ;
29
29
let HTML = HTMLtemplate ;
30
30
let CSS = CSStemplate ;
31
31
let JS = JStemplate ;
32
32
_just . string = require ( '../modules/string.js' ) ;
33
33
_just . element = ( type , insert ) => `<_just${ type ? ` element="${ type } "` : '' } >${ insert || '' } </_just>` ;
34
34
_just . error = require ( '../modules/errmsg.js' ) ;
35
35
_just . ssapi = require ( '../modules/ssapi.js' ) ;
36
+ _just . customCSS = require ( './customcss.js' ) . customcss ;
36
37
37
38
const link = ( text , link_ , ext = false , extid = "ext" , target = "_blank" ) => `<a href="${ link_ } " target="${ target } "${ ext ? ` id="${ extid } "` : '' } >${ text } </a>` ;
38
39
const span = ( text ) => `<span>${ text } </span>` ;
@@ -764,14 +765,22 @@ markdownFiles.forEach(file => {
764
765
logs += `${ l [ 2 ] } OUTPUT: ${ _just . string . runnerPath ( outFilePath ( 'html' ) ) } (${ _just . string . fileSize ( fs . statSync ( outFilePath ( 'html' ) ) . size ) } )` ;
765
766
} ) ;
766
767
768
+ CSS = _just . customCSS ( CSS , customCSS == 'false' ? undefined : customCSS ) ;
769
+
767
770
logs += linklogs ; logs += buttonlogs ;
768
771
logs += `${ l [ 0 ] } USED NAMES:${ l [ 1 ] } "${ uniqueNames_ . join ( '", "' ) } "${ l [ 0 ] } DATA NAMES:${ l [ 1 ] } "${ dataname . join ( '", "' ) } "` ;
769
772
console . log ( '\n\n\n\n\n' + logs ) ;
770
- fs . writeFileSync ( path . join ( rootDirA !== '.' ? rootDirA : rootDirB , '_just_data' , 'output.txt' ) , logs , template . charset ) ;
771
- fs . writeFileSync ( path . join ( rootDirA !== '.' ? rootDirA : rootDirB , '_just' , `${ filename . css } .css` ) , CSS , template . charset ) ;
773
+ const websitepath = rootDirA !== '.' ? rootDirA : rootDirB ;
774
+ fs . writeFileSync ( path . join ( websitepath , '_just_data' , 'output.txt' ) , logs , template . charset ) ;
775
+ fs . writeFileSync ( path . join ( websitepath , '_just' , `${ filename . css } .css` ) , CSS , template . charset ) ;
772
776
fs . writeFileSync (
773
- path . join ( rootDirA !== '.' ? rootDirA : rootDirB , '_just' , `${ filename . js } .js` ) ,
774
- JS . replace ( '\'PUBLICOUTPUT\'' , publicOutput ) . replace ( 'fetch( "/_just/search") ' , `fetch( "/_just/${ dataname [ 9 ] } .json") ` ) ,
777
+ path . join ( websitepath , '_just' , `${ filename . js } .js` ) ,
778
+ JS . replace ( '\'PUBLICOUTPUT\'' , publicOutput ) . replace ( 'let searchurl = "/_just/search"; ' , `let searchurl = "/_just/${ dataname [ 9 ] } .json"; ` ) ,
775
779
template . charset
776
780
) ;
777
- fs . writeFileSync ( path . join ( rootDirA !== '.' ? rootDirA : rootDirB , '_just' , `${ dataname [ 9 ] } .json` ) , JSON . stringify ( mdjson ) , template . charset ) ;
781
+ fs . writeFileSync ( path . join ( websitepath , '_just' , `${ dataname [ 9 ] } .json` ) , JSON . stringify ( mdjson ) , template . charset ) ;
782
+ fs . writeFileSync ( path . join ( websitepath , '_just' , '404.json' ) , JSON . stringify ( {
783
+ "js" : filename . js ,
784
+ "css" : filename . css ,
785
+ "json" : dataname [ 9 ]
786
+ } ) , template . charset )
0 commit comments