move to hono for the platform.
This commit is contained in:
parent
91c2d7b9fd
commit
c39cb5ed34
@ -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>
|
||||||
|
9
app/src/frontend/layout/header.tsx
Normal file
9
app/src/frontend/layout/header.tsx
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
const Header = (props) => {
|
||||||
|
return (
|
||||||
|
<header>
|
||||||
|
<div class="title">{props.title}</div>
|
||||||
|
</header>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Header;
|
@ -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
24
app/src/index.tsx
Normal 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;
|
Loading…
Reference in New Issue
Block a user