mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user