feat: generate dynamic og image for blog posts (#15)

* feat: add dynamic og image using satori
* feat: add og card styling
* feat: add dynamic paths for ogTitle
* feat: add default og url
* ci: change config site url for testing purpose
* fix: update original auto-generate og image style
* refactor: move ogImage jsx inside generateOgImage
* fix: add conditions for filtering draft posts & ogImages
* build: update minor and major dependency updates
* build: update site option in config file
This commit is contained in:
Sat Naing
2022-12-28 09:09:57 +06:30
committed by GitHub
parent f115e1f31d
commit ce3f1dc4a0
5 changed files with 554 additions and 208 deletions
+4 -6
View File
@@ -14,14 +14,12 @@ export interface Props {
const { frontmatter, Content } = Astro.props.post;
const { title, author, description, ogImage, datetime, tags } = frontmatter;
const ogUrl = new URL(ogImage ? ogImage : `${title}.svg`, Astro.url.origin)
.href;
---
<Layout
title={title}
author={author}
description={description}
ogImage={ogImage}
>
<Layout title={title} author={author} description={description} ogImage={ogUrl}>
<Header />
<div class="max-w-3xl mx-auto w-full px-2 flex justify-start">
<button