add gallery

This commit is contained in:
Jianqi Jin 2023-09-26 20:50:20 -05:00
parent 6437bc7371
commit 691ae1e3f9
18 changed files with 26 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1022 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@ -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);
});