Created
March 10, 2020 07:43
-
-
Save kartiknair/3d985cc8d1d41f22fc72dac49bc3ac0b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const homepage = posts => ` | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta name="description" content="${config.blogDescription}" /> | |
<title>${config.blogName}</title> | |
</head> | |
<body> | |
<div class="grotesk"> | |
<header> | |
<h1>${config.blogName}</h1> | |
<p>—</p> | |
<p>This blog is written by ${config.authorName}, ${ | |
config.authorDescription | |
}. To find out what he's up to <a href="${ | |
config.authorTwitter | |
}">follow him on twtter</a></p> | |
<hr /> | |
</header> | |
<div class="posts"> | |
${posts | |
.map( | |
post => `<div class="post"> | |
<h3><a href="./${post.path}">${ | |
post.attributes.title | |
}</a></h3> | |
<small>${new Date( | |
parseInt(post.attributes.date) | |
).toDateString()}</small> | |
<p>${post.attributes.description}</p> | |
</div>` | |
) | |
.join("")} | |
</div> | |
<footer> | |
${`<p>© ${new Date().getFullYear()} ${ | |
config.authorName | |
}, Find the code on <a href="github.com/kartiknair/blog">GitHub</a></p>`} | |
</footer> | |
</div> | |
</body> | |
</html> | |
`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment