-
Notifications
You must be signed in to change notification settings - Fork 0
/
html.js
29 lines (29 loc) · 692 Bytes
/
html.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
module.exports = ({
html = '',
css = '',
scripts,
title,
meta = [],
links = [],
static: staticBuild,
}) => `<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<meta name='generator' content='Compositor x0'>
<title>${title}</title>
${meta
.map(({ name, content }) => `<meta name='${name}' content='${content}'>`)
.join('\n')}
${links
.map(({ rel, href }) => `<link rel='${rel}' href='${href}' />`)
.join('\n')}
<style>*{box-sizing:border-box}body{margin:0;font-family:system-ui,sans-serif}</style>
${css}
</head>
<body>
<div id="root">${html}</div>
${staticBuild ? '' : scripts}
</body>
</html>`;