///////////////////////////
// ADD THE CONTENT
///////////////////////////
let div = document.getElementById('main');
let divText = div.innerHTML;
console.log(divText);
let newPageHTML = `
DeaDvey's Domain
`
document.body.innerHTML = newPageHTML //apply the template
///////////////////////////
// ADD THE LINKS
///////////////////////////
function loadContent(page, content, header, date) {
console.log(page)
let blogText = content
console.log(blogText)
let newPageHTML = `
DeaDvey's Domain
${date}
${header}
${content}
`
document.body.innerHTML = newPageHTML
}
function escapeQuotes(value) {
return value.replace(/["'&<>]/g, function (char) {
switch (char) {
case '"':
return """;
case "'":
return "'";
case "&":
return "&";
case "<":
return "<";
case ">":
return ">";
default:
return char;
}
});
}
console.log(blogs)
let linksDiv = document.getElementById("links")
let linksText
let length = blogs.length
for (let page = 0; page < length; page++) {
console.log(length)
linksText += (`${escapeQuotes(blogs[page][0])} ${escapeQuotes(blogs[page][2])} `)
}
linksText = linksText.slice(9) //Remove the "undefined" at the start of the string
document.getElementById("links").innerHTML = linksText;