diff --git a/blog/blogs.js b/blog/blogs.js new file mode 100644 index 0000000..799f484 --- /dev/null +++ b/blog/blogs.js @@ -0,0 +1,3 @@ +let blogs = [["Test post2", "Testicy Test"], +["Test post", "Testy test!"]] + diff --git a/blog/home-template.js b/blog/home-template.js new file mode 100755 index 0000000..6335414 --- /dev/null +++ b/blog/home-template.js @@ -0,0 +1,82 @@ +/////////////////////////// +// ADD THE CONTENT +/////////////////////////// + +let div = document.getElementById('main'); +let divText = div.innerHTML; + +console.log(divText); + +let newPageHTML = ` + + + + + DeaDvey's Domain + + + + +
+
Home page Blogs Videos
+
+
+ ${divText} + +
+ + +` + +document.body.innerHTML = newPageHTML //apply the template + +/////////////////////////// +// ADD THE LINKS +/////////////////////////// + +function loadContent(page, content, header) { + console.log(page) + let blogText = content + console.log(blogText) + let newPageHTML = ` + + + + + DeaDvey's Domain + + + + +
+
Home page Blogs Videos
+
+
+

${header}

+ ${content} + +
+ + + ` + document.body.innerHTML = newPageHTML +} + +let linksDiv = document.getElementById("links") + +let linksText + +for (let length = blogs.length; length > 0; length--) { + console.log(length) + + linksText += (`
  • ${blogs[length-1][0]}
  • `) +} + +linksText = linksText.slice(9) //Remove the "undefined" at the start of the string + +document.getElementById("links").innerHTML = linksText; + diff --git a/blog/index.html b/blog/index.html index 0259d00..1c8b656 100644 --- a/blog/index.html +++ b/blog/index.html @@ -1,6 +1,9 @@ +
    Welcome to the blog page!
    - \ No newline at end of file + + diff --git a/favicon.ico b/favicon.ico new file mode 100755 index 0000000..46c4676 Binary files /dev/null and b/favicon.ico differ diff --git a/template.js b/template.js index c51561d..7763759 100755 --- a/template.js +++ b/template.js @@ -10,7 +10,7 @@ let newPageHTML = ` DeaDvey's Domain - +