const serverPath = require("./serverPath.js")
const blogs = require(serverPath+"/blog/blogs.js");
const filePath = serverPath+"/blog/blogs/";
const fs = require("fs");
const { pageTop, pageBottom } = require(serverPath+"/html.js")
const comments = require(serverPath+"/blog/comments.js")
console.log(blogs);
/////////////////////////////////
// Make each individual blog page
/////////////////////////////////
for (let length = 0; length < blogs.length; length++) {
console.log(length)
const blogFilePath = filePath + length + ".html";
let content = `${pageTop}
${blogs[length][2]}
${blogs[length][0]}
${blogs[length][1]}
${blogs[length][3] ?
`
${blogs[length][3].map(image => `
`).join('')}
`
: ''}
${blogs[length][4]}
Comments section:
`
if (length > 0) { // Generate link to previous blog
content+=`
${blogs[lastitem][3].map(image => `
`).join('')}
`
: ''}
${blogs[length][3].map(image => `
`).join('')}
`
: ''}