add gallery
|
After Width: | Height: | Size: 440 KiB |
|
After Width: | Height: | Size: 637 KiB |
|
After Width: | Height: | Size: 444 KiB |
|
After Width: | Height: | Size: 537 KiB |
|
After Width: | Height: | Size: 581 KiB |
|
After Width: | Height: | Size: 542 KiB |
|
After Width: | Height: | Size: 554 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 913 KiB |
|
After Width: | Height: | Size: 898 KiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 1022 KiB |
|
After Width: | Height: | Size: 1.4 MiB |
@@ -0,0 +1,26 @@
|
|||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
let res = "";
|
||||||
|
let json = `const gallery = {
|
||||||
|
pic: [`;
|
||||||
|
|
||||||
|
let jsonEnd = `
|
||||||
|
],
|
||||||
|
};`;
|
||||||
|
fs.readdir("./", (err, files) => {
|
||||||
|
files.forEach((file, index) => {
|
||||||
|
if (file === "readimg.js") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log(file);
|
||||||
|
res += `import pic${index} from "../pics/gallery/${file}";\n`;
|
||||||
|
json += `{
|
||||||
|
title: "",
|
||||||
|
content: "",
|
||||||
|
img: pic${index}
|
||||||
|
},`;
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(res);
|
||||||
|
console.log(json + jsonEnd);
|
||||||
|
});
|
||||||