Set up the post titles
This commit is contained in:
parent
fcfed30ce9
commit
046830730c
@ -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"
|
||||
|
@ -3,4 +3,5 @@ export type SiteMeta = {
|
||||
tags?: string[],
|
||||
author?: string,
|
||||
viewport?: string,
|
||||
title?: string,
|
||||
};
|
||||
|
@ -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" />
|
||||
|
Loading…
Reference in New Issue
Block a user