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.js";
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
Fri, Nov 22, 08:58 (3 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
547669
Default Alt Text
html.ts (881 B)

Event Timeline