diff --git a/src/handlers/posts.tsx b/src/handlers/posts.tsx index 9bb923b..d1dae0b 100644 --- a/src/handlers/posts.tsx +++ b/src/handlers/posts.tsx @@ -24,6 +24,7 @@ export async function handleSinglePost(c: Context) { } const meta: SiteMeta = { + title: post.meta.title, description: post.meta.description, tags: post.meta.tags, author: "Dave Smith-Hayes" diff --git a/src/models/SiteMeta.ts b/src/models/SiteMeta.ts index cb7d6c7..6a0e3dd 100644 --- a/src/models/SiteMeta.ts +++ b/src/models/SiteMeta.ts @@ -3,4 +3,5 @@ export type SiteMeta = { tags?: string[], author?: string, viewport?: string, + title?: string, }; diff --git a/src/templates/Page.tsx b/src/templates/Page.tsx index 5a87bcc..35aca2f 100644 --- a/src/templates/Page.tsx +++ b/src/templates/Page.tsx @@ -2,11 +2,19 @@ import { Style } from 'hono/css'; import { SiteMeta } from '@blog/models/SiteMeta'; import { MetaTags } from '@blog/templates/components/MetaTags'; +function getPageTitle(title: string|undefined): string { + if (!title) { + return ""; + } + + return title + " - "; +} + export function Page({ children, meta }: { children: any, meta: SiteMeta }) { return (
-