move to hono for the platform.

This commit is contained in:
Dave Smith-Hayes 2024-03-02 12:26:15 -05:00
parent 91c2d7b9fd
commit c39cb5ed34
4 changed files with 35 additions and 9 deletions

View File

@ -1,4 +1,5 @@
import { FC } from 'hono/jsx'; import { FC } from 'hono/jsx';
import Header from './layout/header';
const Layout: FC = (props) => { const Layout: FC = (props) => {
return ( return (
@ -7,6 +8,7 @@ const Layout: FC = (props) => {
<title>{props.siteData.title}</title> <title>{props.siteData.title}</title>
</head> </head>
<body> <body>
<Header title={props.siteData.title}/>
{props.children} {props.children}
</body> </body>
</html> </html>

View File

@ -0,0 +1,9 @@
const Header = (props) => {
return (
<header>
<div class="title">{props.title}</div>
</header>
);
};
export default Header;

View File

@ -1,9 +0,0 @@
import { Hono } from 'hono';
const app = new Hono();
app.get('/', (c) => {
return c.text('Hello Hono!');
});
export default app;

24
app/src/index.tsx Normal file
View File

@ -0,0 +1,24 @@
import { Hono } from 'hono';
import SiteData from './model/SiteData';
import Layout from './frontend/layout';
const app = new Hono();
app.get('/', (c) => {
const siteData: SiteData = {
title: "Slovocast",
description: "A no-nonsense podcast hosting platform."
};
const layout = (
<Layout siteData={siteData}>
<main>
<h1>Slovocast</h1>
</main>
</Layout>
);
return c.html(layout);
});
export default app;