const projects = require("/var/www/html/project/projects.js");
const filePath = "/var/www/html/project/projects/";
const fs = require("fs");
const { pageTop, pageBottom } = require("/var/www/html/html.js")
let content = `${pageTop}
Name: |
Description: |
Language(s): |
Dependencies: |
Date of Development: |
.zip: |
.tar.gz: |
`
console.log(projects);
////////////////////////////////
// Make each individual blog page
/////////////////////////////////
for (let length = 0; length < projects.length; length++) {
console.log(length)
content += `
${projects[length][0]} |
${projects[length][1]} |
${projects[length][2]} |
${projects[length][3]} |
${projects[length][4]} |
|
| `
}
content += `
${pageBottom}`
fs.writeFile("/var/www/html/project/index.html", content, (err) => {
if (err) {
console.error('Error creating file:', err);
} else {
console.log('File edited successfully: /var/www/html/project/index.html', );
}
});