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 ( +
+ + xにシェアする + Post + + + Follow @yossydev + +
+ ); +} 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

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