Skip to content

Commit 32fae85

Browse files
committed
fix about default og:image
1 parent 0f17c40 commit 32fae85

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

bun.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@tailwindcss/typography": "^0.5.16",
3232
"astro": "^5.5.5",
3333
"astro-icon": "^1.1.5",
34-
"bits-ui": "^1.3.13",
34+
"bits-ui": "^1.3.14",
3535
"daisyui": "^5.0.9",
3636
"date-fns": "^4.1.0",
3737
"markdown-to-txt": "^2.0.1",

src/layouts/GlobalLayout.astro

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import { ClientRouter } from "astro:transitions";
33
import Footer from "+/components/Footer.astro";
44
import Header from "+/components/Header.astro";
5-
import Logo from "+/images/logo/normal.svg";
65
import type { Focus } from "+/schema";
76
import Meta from "./meta.astro";
87
@@ -17,7 +16,7 @@ const { title, description, focus, image } = Astro.props;
1716
---
1817

1918
<html lang="ja" class="bg-gray-50 text-gray-800" data-theme="light">
20-
<Meta {title} {description} image={image ?? Logo} />
19+
<Meta {title} {description} image={image} />
2120
<body class="min-h-full w-full">
2221
<style is:global>
2322
@import "+/global.css";

src/layouts/meta.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ interface Props {
33
title: string | null;
44
description: string | null;
55
keywords?: string[];
6-
image: ImageMetadata;
6+
image: ImageMetadata | null;
77
}
88
const { title, description, keywords = [], image } = Astro.props;
99
const url = Astro.url.href;
@@ -22,7 +22,7 @@ const url = Astro.url.href;
2222
<meta property="og:site_name" content="ut.code();" />
2323
<meta property="og:title" content={title} />
2424
{description && <meta property="og:description" content={description} />}
25-
<meta property="og:image" content={image.src} />
25+
<meta property="og:image" content={image?.src ?? "/utcode-logo/normal.svg"} />
2626
<meta property="og:url" content={url} />
2727
<meta property="og:locale" content="ja_JP" />
2828
<meta name="twitter:card" content="summary_large_image" />

0 commit comments

Comments
 (0)