mirror of
https://github.com/kou029w/_.git
synced 2025-02-07 09:38:46 +00:00
refactor
This commit is contained in:
parent
254efe47b6
commit
db8b7490c7
1 changed files with 8 additions and 6 deletions
|
@ -3,14 +3,16 @@ import { escapeInject, dangerouslySkipEscape } from "vite-plugin-ssr";
|
||||||
import type { PageContextBuiltIn } from "vite-plugin-ssr/types";
|
import type { PageContextBuiltIn } from "vite-plugin-ssr/types";
|
||||||
|
|
||||||
export async function render(pageContext: PageContextBuiltIn) {
|
export async function render(pageContext: PageContextBuiltIn) {
|
||||||
const { Page } = pageContext;
|
const html = renderToString(
|
||||||
const html = renderToString(<Page />);
|
|
||||||
|
|
||||||
return escapeInject`<!DOCTYPE html>
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>vite-ssg-example</title>
|
<title>vite-ssg-example</title>
|
||||||
</head>
|
</head>
|
||||||
<body>${dangerouslySkipEscape(html)}</body>
|
<body>
|
||||||
</html>`;
|
<pageContext.Page />
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
);
|
||||||
|
|
||||||
|
return escapeInject`<!DOCTYPE html>${dangerouslySkipEscape(html)}`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue