diff --git a/src/model/SiteMeta.ts b/src/model/SiteMeta.ts
index 1228754..2765927 100644
--- a/src/model/SiteMeta.ts
+++ b/src/model/SiteMeta.ts
@@ -1,5 +1,5 @@
export type SiteMeta = {
- description: string,
- tags: string[],
+ description?: string,
+ tags?: string[],
author?: string,
};
diff --git a/src/routes/posts.tsx b/src/routes/posts.tsx
index c69c8b0..33c2c5a 100644
--- a/src/routes/posts.tsx
+++ b/src/routes/posts.tsx
@@ -1,9 +1,9 @@
import { Hono } from 'hono';
-
import { PostPage } from '@blog/templates/Pages/PostPage';
import { FourOhFour } from '@blog/templates/Pages/FourOhFour';
import { readdir } from 'node:fs/promises';
-import { readPostMarkdown } from '@blog/util/readPostMarkdown';
+import { SiteMeta } from '@blog/model/SiteMeta';
+import { readPostMarkdown } from '@blog/util/post-reader';
const app = new Hono();
@@ -18,8 +18,14 @@ app.get('/posts/:slug', async (c) => {
return c.render();
}
- const post = await readPostMarkdown(__dirname + "/../posts/" + postFile);
- return c.render();
+ const post = await readPostMarkdown(postFile);
+ const meta = {
+ description: post.meta.description,
+ tags: post.meta.tags,
+ author: "Dave Smith-Hayes"
+ };
+
+ return c.render(, { meta });
});
export default app;
diff --git a/src/templates/Page.tsx b/src/templates/Page.tsx
index ffb0404..162d796 100644
--- a/src/templates/Page.tsx
+++ b/src/templates/Page.tsx
@@ -1,5 +1,6 @@
import { css, Style } from 'hono/css';
import { SiteMeta } from '@blog/model/SiteMeta';
+import { MetaTags } from '@blog/templates/components/MetaTags';
const logoClass = css`
font-size: 16pt;
@@ -10,6 +11,7 @@ export function Page({ children, meta }: { children: any, meta: SiteMeta }) {
davesmithhayes.com
+
diff --git a/src/templates/Pages/PostPage.tsx b/src/templates/Pages/PostPage.tsx
index 99fba00..158f03b 100644
--- a/src/templates/Pages/PostPage.tsx
+++ b/src/templates/Pages/PostPage.tsx
@@ -1,10 +1,10 @@
-import { Post } from "@blog/templates/Pages";
+import { Post } from "@blog/model/Post";
export function PostPage({ post }: { post: Post }) {
- const html = { __html: post.content };
+ const html = { __html: post.html ?? '' };
return (
<>
- {post.title}
+ {post.meta.title}
>
);
diff --git a/src/templates/components/MetaTags.tsx b/src/templates/components/MetaTags.tsx
index 8488524..36ff03e 100644
--- a/src/templates/components/MetaTags.tsx
+++ b/src/templates/components/MetaTags.tsx
@@ -24,11 +24,12 @@ export function Author({ meta }: { meta: SiteMeta }) {
return ();
}
-export function MetaTags(meta: SiteMeta) {
+export function MetaTags({ meta }: { meta: SiteMeta }) {
return (
<>
+
>
)
}