Skip to content

Instantly share code, notes, and snippets.

@kartiknair
Created March 10, 2020 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kartiknair/3a6860f06cfe72ce2bd0d4b6801aa876 to your computer and use it in GitHub Desktop.
Save kartiknair/3a6860f06cfe72ce2bd0d4b6801aa876 to your computer and use it in GitHub Desktop.
const posthtml = data => `
<!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="${data.attributes.description}" />
<title>${data.attributes.title}</title>
</head>
<body>
<header>
<a href="/">Go back home</a>
</header>
<div class="content">
<h1>${data.attributes.title}</h1>
<p>${new Date(parseInt(data.attributes.date)).toDateString()}</p>
<hr />
${data.body}
</div>
</body>
</html>
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment