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 = {
|
const meta: SiteMeta = {
|
||||||
|
title: post.meta.title,
|
||||||
description: post.meta.description,
|
description: post.meta.description,
|
||||||
tags: post.meta.tags,
|
tags: post.meta.tags,
|
||||||
author: "Dave Smith-Hayes"
|
author: "Dave Smith-Hayes"
|
||||||
|
@ -3,4 +3,5 @@ export type SiteMeta = {
|
|||||||
tags?: string[],
|
tags?: string[],
|
||||||
author?: string,
|
author?: string,
|
||||||
viewport?: string,
|
viewport?: string,
|
||||||
|
title?: string,
|
||||||
};
|
};
|
||||||
|
@ -2,11 +2,19 @@ import { Style } from 'hono/css';
|
|||||||
import { SiteMeta } from '@blog/models/SiteMeta';
|
import { SiteMeta } from '@blog/models/SiteMeta';
|
||||||
import { MetaTags } from '@blog/templates/components/MetaTags';
|
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 }) {
|
export function Page({ children, meta }: { children: any, meta: SiteMeta }) {
|
||||||
return (
|
return (
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>davesmithhayes.com</title>
|
<title>{ getPageTitle(meta.title) }davesmithhayes.com</title>
|
||||||
<MetaTags meta={meta} />
|
<MetaTags meta={meta} />
|
||||||
<Style />
|
<Style />
|
||||||
<link rel="stylesheet" href="/static/main.css" />
|
<link rel="stylesheet" href="/static/main.css" />
|
||||||
|
Loading…
Reference in New Issue
Block a user