36 lines
979 B
TypeScript
36 lines
979 B
TypeScript
import { Header } from "./components/Header";
|
|
import { Home } from "./pages/home";
|
|
import { Blog } from "./pages/blog";
|
|
import { Projects } from "./pages/projects";
|
|
|
|
export function Index(path: string) {
|
|
return (
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<script defer src="./htmx.min.js"></script>
|
|
<title>Caleb's Blog</title>
|
|
<link rel="stylesheet" href="./styles.css" />
|
|
</head>
|
|
<body>
|
|
<Header />
|
|
<main>
|
|
{selectPage(path)}
|
|
</main>
|
|
</body>
|
|
</html>
|
|
)
|
|
}
|
|
|
|
export function selectPage(path: string) {
|
|
switch (path) {
|
|
case '/':
|
|
return <Home />
|
|
case '/blog':
|
|
return <Blog />
|
|
case '/projects':
|
|
return <Projects />
|
|
}
|
|
}
|