Compare commits

...

1 Commits

4 changed files with 39 additions and 0 deletions

16
src/handlers/about.tsx Normal file
View File

@ -0,0 +1,16 @@
import { Hono, Context } from 'hono';
const aboutPage = new Hono();
export async handleAboutPage(c: Context) {
const meta: SiteMeta = {
title: "About",
description: "About Dave Smith-Hayes - a dad, developer, musician.",
author: "Dave Smith-Hayes"
};
c.render(<AboutPage />, { meta });
}
aboutPage.get("/about", handleAboutPage);
export default aboutPage;

View File

@ -1,6 +1,7 @@
import { Style } from 'hono/css'; import { Style } from 'hono/css';
import { SiteMeta } from '@blog/models/SiteMeta'; import { SiteMeta } from '@blog/models/SiteMeta';
import { MetaTags } from '@blog/templates/components/MetaTags'; import { MetaTags } from '@blog/templates/components/MetaTags';
import { Navigation } from '@blog/templates/componennts/Navigation';
function getPageTitle(title: string|undefined): string { function getPageTitle(title: string|undefined): string {
if (!title) { if (!title) {
@ -25,6 +26,9 @@ export function Page({ children, meta }: { children: any, meta: SiteMeta }) {
<a href="/">davesmithhayes.com</a> <a href="/">davesmithhayes.com</a>
</div> </div>
</header> </header>
<nav>
<Navigation />
</nav>
<main> <main>
{children} {children}
</main> </main>

View File

@ -0,0 +1,7 @@
export function AboutPage() {
return (
<div class="main">
<p>Hello! I am Dave Smith-Hayes.</p>
</div>
);
}

View File

@ -0,0 +1,12 @@
const pages: Array<{ path: string, title: string }> = [
{ path: "/", title: "Home" },
{ path: "/about", title: "About" },
];
export function Navigation() {
return (
<ul>
{pages.map(p => <li><a href={p.path}>{p.title}</a></li> )}
</ul>
);
}