Skip to content

Commit

Permalink
feat: ogp設定
Browse files Browse the repository at this point in the history
  • Loading branch information
yossydev committed Mar 5, 2024
1 parent f5040ad commit d3c9f38
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions app/routes/_renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@ import { jsxRenderer } from "hono/jsx-renderer";
import { Script } from "honox/server";
import { LINK } from "../constants";

export default jsxRenderer(({ children, title }) => {
export default jsxRenderer(({ children, title, description }) => {
const _title = title ?? "yossy.dev";
const _description = description ?? "yossydev's personal blog";
const _image = "/static/profile-image.png";

return (
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{<title>{title ?? "yossy.dev"}</title>}
<title>{_title}</title>
<meta property="og:title" content={_title} />
<meta property="og:description" content={_description} />
<meta property="og:image" content={_image} />
<meta name="twitter:site" content="@yossydev" />
<meta name="twitter:image" content={_image} />
<meta name="twitter:card" content="summary_large_image" />
<Script src="/app/client.ts" async />
<Style />
{import.meta.env.PROD ? (
Expand All @@ -24,6 +34,7 @@ export default jsxRenderer(({ children, title }) => {
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" />
<script>hljs.highlightAll();</script>

<body>
<header class="mt-3 bg-black">
<div class="max-w-screen-2xl mx-auto flex h-16 items-center justify-between px-6">
Expand Down
Binary file added public/static/profile-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d3c9f38

Please sign in to comment.