1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-30 22:08:02 +00:00
This commit is contained in:
Nebel 2021-10-13 19:50:32 +09:00
parent 254efe47b6
commit db8b7490c7

View file

@ -3,14 +3,16 @@ import { escapeInject, dangerouslySkipEscape } from "vite-plugin-ssr";
import type { PageContextBuiltIn } from "vite-plugin-ssr/types";
export async function render(pageContext: PageContextBuiltIn) {
const { Page } = pageContext;
const html = renderToString(<Page />);
return escapeInject`<!DOCTYPE html>
const html = renderToString(
<html>
<head>
<title>vite-ssg-example</title>
</head>
<body>${dangerouslySkipEscape(html)}</body>
</html>`;
<body>
<pageContext.Page />
</body>
</html>
);
return escapeInject`<!DOCTYPE html>${dangerouslySkipEscape(html)}`;
}