import type { WebConfig } from "#lib/server/config.ts"; import { themeAttribute, themeFromCookies } from "#lib/theme.ts"; export type PageHosts = Pick; // fills the markers app.html leaves for what only the request or the deploy knows export const stampPage = (html: string, request: Request, { avatarUrl, camoUrl }: PageHosts) => html .replace("%tangled.theme%", themeAttribute(themeFromCookies(request.headers.get("cookie")))) .replace("%tangled.avatar%", avatarUrl) .replace("%tangled.camo%", camoUrl);