feat: add OpenGraph image generation support - #600
Closed
EveSunMaple wants to merge 8 commits into
Closed
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
|
请求检查 @L4Ph 本地
上图报错在我本地修改时曾经出现过一次(因为打开那个文件),关闭后又回复正常。Vercel 部署无误,请问这是什么问题?
|
Contributor
Author
|
我已经使用 biome 正确格式化了代码,现在可以通过检查了。 同时,我已经改成通过网络请求字体,不需要在仓库中额外添加字体文件。 |
Xeonzilla
pushed a commit
to Xeonzilla/astro-blog
that referenced
this pull request
Sep 23, 2025
style: format code and fix indentation fix: simplify favicon selection logic style: format code and fix indentation refactor: load fonts from google fonts dynamically refactor: improve font loading and type definitions Reference: [Upstream#600](saicaca/fuwari#600)
Xeonzilla
pushed a commit
to Xeonzilla/astro-blog
that referenced
this pull request
Sep 24, 2025
style: format code and fix indentation fix: simplify favicon selection logic style: format code and fix indentation refactor: load fonts from google fonts dynamically refactor: improve font loading and type definitions Reference: [Upstream#600](/saicaca/fuwari/pull/600)
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Type of change
Checklist
Related Issue
我发现有一个相关的 PR #80
但是它并没有被合并,当前的仓库版本也并没有在
Layout配置og:image。Changes
新增了 Open Graph (OG) 图片自动生成功能,为每篇文章在构建时生成一张独特的社交媒体分享图。此功能深度契合 Fuwari 主题的视觉风格,并提供高度可配置性。
主要更新包括:
siteConfig中的themeColor.hue自动调整,与网站主题保持视觉统一。siteConfig中新增generateOgImages选项,用户可以方便地在src/config.ts中启用或禁用此功能,以在不需要时加快构建速度。src/layouts/Layout.astro,为文章页自动添加正确的<meta property="og:image" ...>标签,并为非文章页面提供备选的默认分享图。How To Test
src/config.ts文件中的generateOgImages选项为true。pnpm build)。dist/)下是否存在og/文件夹及生成的.png图片。<head>中已正确添加<meta property="og:image" ...>标签,且其content指向正确的图片绝对路径 URL。generateOgImages设为false并重新构建,确认dist/目录下不再生成og/文件夹。Screenshots (if applicable)
Additional Notes
satori,用于在服务端生成图片。src/pages/posts/[slug].astro)中,向Layout.astro组件传递postSlug属性,以正确链接到生成的图片(此部分已经修改)。