File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -53,23 +53,23 @@ async function run(argv) {
5353
5454 await createImages ( postData ) ;
5555
56- const rows = chunk ( postData , 5 ) . map (
57- chunk =>
58- "| " +
59- chunk
60- . map (
61- postData =>
62- `<a href='${ postData . folder } '><img src='${
63- postData . folder
64- } /cover.jpg' width='140px;' /></a><h4 align='center'><a href='${
65- postData . folder
66- } '>${ postData . title } </a><h4>`
67- )
68- . join ( " | " ) +
69- " |"
56+ const items = postData . map (
57+ postData =>
58+ `<a href='${ postData . folder } '><img src='${
59+ postData . folder
60+ } /cover.jpg' width='140px;' /></a><h4 align='center'><a href='${
61+ postData . folder
62+ } '>${ postData . title } </a><h4>`
7063 ) ;
64+
65+ const rows = chunk ( items , 5 ) . map ( chunk => `| ` + chunk . join ( " | " ) + ` |` ) ;
66+
7167 let output =
72- rows . join ( "\n" ) + "\n" + "| :---: | :---: | :---: | :---: | :---: |" ;
68+ rows [ 0 ] +
69+ "\n" +
70+ "| :---: | :---: | :---: | :---: | :---: |\n" +
71+ rows . slice ( 1 ) . join ( "\n" ) ;
72+
7373 console . log ( output ) ;
7474}
7575
You can’t perform that action at this time.
0 commit comments