Page MenuHomeSealhub

html.ts
No OneTemporary

import { Templatable, tempstream } from "tempstream";
import { Readable } from "stream";
import { BaseContext } from "koa";
import navbar from "./routes/common/navbar";
export const defaultHead = (ctx: BaseContext, title: string) => /* HTML */ `<title>
${title} · ${ctx.$app.manifest.name}
</title>
<meta name="viewport" content="width=device-width" />
<script async src="/dist/bundle.js"></script>
<link href="/dist/style.css" rel="stylesheet" type="text/css" />`;
export default function html(
ctx: BaseContext,
title: string,
body: Templatable,
makeHead: (ctx: BaseContext, title: string) => Templatable = defaultHead
): Readable {
ctx.set("content-type", "text/html;charset=utf-8");
return tempstream/* HTML */ ` <!DOCTYPE html>
<html lang="pl">
<head>
${makeHead(ctx, title)}
</head>
<body>
${navbar(ctx)} ${body}
</body>
</html>`;
}

File Metadata

Mime Type
text/html
Expires
Tue, Dec 24, 14:05 (9 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
557308
Default Alt Text
html.ts (878 B)

Event Timeline