mirror of
https://github.com/kou029w/_.git
synced 2025-01-31 06:18:07 +00:00
17 lines
464 B
TypeScript
17 lines
464 B
TypeScript
import { renderToString } from "solid-js/web";
|
|
import { escapeInject, dangerouslySkipEscape } from "vite-plugin-ssr";
|
|
import type { PageContextBuiltIn } from "vite-plugin-ssr/types";
|
|
|
|
export async function render(pageContext: PageContextBuiltIn) {
|
|
const page = renderToString(pageContext.Page);
|
|
return escapeInject`<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>vite-ssg-example</title>
|
|
</head>
|
|
<body>
|
|
${dangerouslySkipEscape(page)}
|
|
</body>
|
|
</html>
|
|
`;
|
|
}
|