From cc78295cb99b04fba3aac705da3890936067119b Mon Sep 17 00:00:00 2001 From: yossydev Date: Wed, 6 Mar 2024 05:44:19 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20x=E9=96=A2=E9=80=A3=E3=81=AE=E3=83=9C?= =?UTF-8?q?=E3=82=BF=E3=83=B3=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/islands/share.tsx | 38 ++++++++++++++++++++++++++++++++++ app/routes/_renderer.tsx | 15 +++++++------- app/routes/posts/_renderer.tsx | 8 +++---- app/routes/posts/index.tsx | 11 ++++++++++ 4 files changed, 60 insertions(+), 12 deletions(-) create mode 100644 app/islands/share.tsx create mode 100644 app/routes/posts/index.tsx diff --git a/app/islands/share.tsx b/app/islands/share.tsx new file mode 100644 index 0000000..87eb181 --- /dev/null +++ b/app/islands/share.tsx @@ -0,0 +1,38 @@ +import { LINK } from "../constants"; + +export default function Share({ title }: { title: string }) { + if (typeof window === "undefined") { + return ( +
+
+
+
+
+ ); + } + return ( + + ); +} diff --git a/app/routes/_renderer.tsx b/app/routes/_renderer.tsx index 30eb690..17b4af0 100644 --- a/app/routes/_renderer.tsx +++ b/app/routes/_renderer.tsx @@ -1,6 +1,6 @@ import { Style } from "hono/css"; import { jsxRenderer } from "hono/jsx-renderer"; -import { Script } from "honox/server"; +import { HasIslands, Script } from "honox/server"; import { LINK } from "../constants"; export default jsxRenderer(({ children, title, description }) => { @@ -27,14 +27,13 @@ export default jsxRenderer(({ children, title, description }) => { ) : ( )} + + - - -
diff --git a/app/routes/posts/_renderer.tsx b/app/routes/posts/_renderer.tsx index c820b2a..6e88e8b 100644 --- a/app/routes/posts/_renderer.tsx +++ b/app/routes/posts/_renderer.tsx @@ -1,12 +1,12 @@ import { jsxRenderer } from "hono/jsx-renderer"; +import Share from "../../islands/share"; export default jsxRenderer(({ children, Layout, frontmatter }) => { + const _title = `${frontmatter?.title} | yossy.dev`; return ( - +
{children}
+
); }); diff --git a/app/routes/posts/index.tsx b/app/routes/posts/index.tsx new file mode 100644 index 0000000..a074bb9 --- /dev/null +++ b/app/routes/posts/index.tsx @@ -0,0 +1,11 @@ +import { createRoute } from "honox/factory"; +import Share from "../../islands/share"; + +export default createRoute((c) => { + return c.render( +
+

Hello

+
, + {}, + ); +});