init
This commit is contained in:
31
components/Layout.ts
Normal file
31
components/Layout.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { ghPagesBasePath, html, type Html } from "@mastrojs/mastro";
|
||||
import { Header } from "./Header.ts";
|
||||
import { Footer } from "./Footer.ts";
|
||||
|
||||
export const basePath = ghPagesBasePath();
|
||||
|
||||
interface Props {
|
||||
title?: string;
|
||||
children: Html;
|
||||
}
|
||||
|
||||
export const Layout = (props: Props) =>
|
||||
html`
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>${props.title}</title>
|
||||
<link rel="stylesheet" href=${basePath + "/styles.css"}>
|
||||
<meta name="viewport" content="width=device-width">
|
||||
</head>
|
||||
<body>
|
||||
${Header()}
|
||||
|
||||
<main>
|
||||
${props.children}
|
||||
</main>
|
||||
|
||||
${Footer()}
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
Reference in New Issue
Block a user