Refactor as SSG using Vite+React

This commit is contained in:
Michael Bradley 2025-01-03 00:50:52 +13:00
parent a22071815d
commit 6830bd41dd
Signed by: MichaelBradley
SSH key fingerprint: SHA256:cj/YZ5VT+QOKncqSkx+ibKTIn0Obg7OIzwzl9BL8EO8
25 changed files with 3076 additions and 282 deletions

22
src/entry-server.tsx Normal file
View file

@ -0,0 +1,22 @@
// Entry point for SSG
import { renderToString } from "react-dom/server";
import Body from "./Body";
import Head from "./Head";
import style from "./style.css?inline";
export const render = () => {
const html =
"<!doctype html>" +
renderToString(
<html lang="en">
<head>
<Head />
<style type="text/css">{style}</style>
</head>
<body>
<Body />
</body>
</html>,
);
return { html };
};