generated from Seekra/repository-template
feat(legal): use HTML template at build to ensure an entire HTML document
This commit is contained in:
+22
-1
@@ -24,7 +24,28 @@ export default async function build () {
|
|||||||
const legalNoticeMd = await readFile('./src/legal/legal_notice.md', { encoding: 'utf-8' });
|
const legalNoticeMd = await readFile('./src/legal/legal_notice.md', { encoding: 'utf-8' });
|
||||||
const legalNoticeHtml = md.render(legalNoticeMd);
|
const legalNoticeHtml = md.render(legalNoticeMd);
|
||||||
|
|
||||||
const legalNoticeHtmlMinified = await minify(legalNoticeHtml, {
|
const fullLegalNoticeHTML = `
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>
|
||||||
|
Legal Notice
|
||||||
|
</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<h1>
|
||||||
|
Legal Notice
|
||||||
|
</h1>
|
||||||
|
</header>
|
||||||
|
<main>
|
||||||
|
${legalNoticeHtml}
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>`;
|
||||||
|
|
||||||
|
const legalNoticeHtmlMinified = await minify(fullLegalNoticeHTML, {
|
||||||
collapseWhitespace: true,
|
collapseWhitespace: true,
|
||||||
conservativeCollapse: true,
|
conservativeCollapse: true,
|
||||||
collapseInlineTagWhitespace: true,
|
collapseInlineTagWhitespace: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user