mirror of
https://github.com/kou029w/_.git
synced 2025-01-30 22:08:02 +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";
|
||||
|
||||
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)}`;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue