const pages = require("/var/www/html/theunderland/wiki/pages.js"); const filePath = "/var/www/html/theunderland/wiki/pages/"; const fs = require("fs"); const { pageTop, pageBottom } = require("/var/www/html/html.js") console.log(pages); //////////////////////////////// // Make each individual blog page ///////////////////////////////// for (let length = 0; length < pages.length; length++) { console.log(length) const pageFilePath = filePath + pages[length][0] + ".html"; // Makes anything surrounded by && into a link to that page let wikiText = pages[length][2]; wikiText = wikiText.replace(/&&([^&]+)&&/g, '$1'); let content = `

${pages[length][0]}


${wikiText}



Links

Search Page
TUC Timeline (External)
TUC Discord (External)
The Underland Project (External)

Thanks to:

The Underland Chronicles Fandom For a good resource while researching, licensed under CC-BY-SA
Wikipedia For a good resource while researching, licensed under Creative Commons Attribution-ShareAlike License 4.0
` fs.writeFile(pageFilePath, content, (err) => { if (err) { console.error('Error creating file:', err); } else { console.log('File created successfully:', pageFilePath); } }); }