Skip to content

Commit

Permalink
chore: descriptionの型を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
yossydev committed Mar 5, 2024
1 parent d3c9f38 commit c7b125b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import {} from "hono";

type Head = {
title?: string;
description?: string;
};

declare module "hono" {
interface ContextRenderer {
(
content: string | Promise<string>,
head?: Head & { frontmatter?: Head },
head?: Head & { frontmatter?: Head; description?: string },
): Response | Promise<Response>;
}
}
5 changes: 4 additions & 1 deletion app/routes/posts/_renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { jsxRenderer } from "hono/jsx-renderer";

export default jsxRenderer(({ children, Layout, frontmatter }) => {
return (
<Layout title={`${frontmatter?.title} | yossy.dev`}>
<Layout
title={`${frontmatter?.title} | yossy.dev`}
description={frontmatter?.description}
>
<div class="markdown">{children}</div>
</Layout>
);
Expand Down

0 comments on commit c7b125b

Please sign in to comment.