Skip to content

Commit

Permalink
fix: OGP画像パスをフルパスに修正(#116)
Browse files Browse the repository at this point in the history
いつからかTwitterだけOGP画像がうまく表示されないようになってしまったため。
  • Loading branch information
h-yoshikawa44 committed Oct 7, 2023
1 parent f1c2529 commit d00f8a4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/BaseHead.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ const canonicalURL =
: new URL(Astro.url.pathname, Astro.site);
const { title, description = SITE_DESCRIPTION } = Astro.props;
const titleWithSiteTitle = title ? `${title} | ${SITE_TITLE}` : SITE_TITLE;
const simpleTitle = title ? title : SITE_TITLE;
const ogpImage = new URL('/ogp.png', Astro.site?.origin!);
const GOOGLE_SITE_VERIFICATION = import.meta.env.GOOGLE_SITE_VERIFICATION;
---

Expand All @@ -40,14 +41,14 @@ const GOOGLE_SITE_VERIFICATION = import.meta.env.GOOGLE_SITE_VERIFICATION;
<meta property="og:url" content={Astro.url} />
<meta property="og:title" content={simpleTitle} />
<meta property="og:description" content={description} />
<meta property="og:image" content="/ogp.png" />
<meta property="og:image" content={ogpImage} />

<!-- Twitter -->
<meta property="twitter:card" content="summary" />
<meta property="twitter:url" content={Astro.url} />
<meta property="twitter:title" content={simpleTitle} />
<meta property="twitter:description" content={description} />
<meta property="twitter:image" content="/ogp.png" />
<meta property="twitter:image" content={ogpImage} />

<!-- Google Search Console -->
<meta name="google-site-verification" content={GOOGLE_SITE_VERIFICATION} />

0 comments on commit d00f8a4

Please sign in to comment.