Set up the post titles

This commit is contained in:
Dave Smith-Hayes 2024-08-11 21:53:17 -04:00
parent fcfed30ce9
commit 046830730c
3 changed files with 11 additions and 1 deletions

View File

@ -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"

View File

@ -3,4 +3,5 @@ export type SiteMeta = {
tags?: string[],
author?: string,
viewport?: string,
title?: string,
};

View File

@ -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 (
<html lang="en">
<head>
<title>davesmithhayes.com</title>
<title>{ getPageTitle(meta.title) }davesmithhayes.com</title>
<MetaTags meta={meta} />
<Style />
<link rel="stylesheet" href="/static/main.css" />