-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.js
executable file
·32 lines (22 loc) · 969 Bytes
/
template.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
let div = document.getElementById('main');
let divText = div.innerHTML;
console.log(divText);
let newPageHTML = `${pageTop}${divText}${pageBottom}`
document.body.innerHTML = newPageHTML
function goToLink(link) {
window.location.href = link
}
// Write latest commits to page
let commitsDiv = document.getElementById("commits")
commitsDiv.innerHTML = commits
// Write latest blog to home page
let latestBlogDiv = document.getElementById("latestBlog");
let blogText = `<h5 class="blog-title"><a href="/blog/blogs/${blogs.length-1}.html">${blogs[blogs.length - 1][0]}</a></h5>
${blogs[blogs.length - 1][1]}
${blogs[blogs.length - 1][3] ?
`<div class="blog-images">
${blogs[blogs.length - 1][3].map(image => `<img class="blog-image" height="200" src="/images/${image}" alt="${image}" />`).join('')}
</div>`
: ''}`
let blogHTML = `${blogText}`
latestBlogDiv.innerHTML = blogHTML