File tree Expand file tree Collapse file tree 4 files changed +11
-5
lines changed
Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ useSeoMeta({
1515 ogTitle: props .frontmatter .title ,
1616 ogDescription: props .frontmatter .description || props .frontmatter .excerpt ,
1717 ogType: ' article' ,
18+ ogImage: props .frontmatter .image ,
1819 ... (props .frontmatter .draft ? { robots: ' noindex, nofollow' } : {}),
1920})
2021
@@ -27,11 +28,13 @@ useHead({
2728 ],
2829})
2930
30- defineOgImageComponent (' BlogPost' , {
31- title: props .frontmatter .title ,
32- authors: post .value ?.authors ?? [],
33- date: props .frontmatter .date ,
34- })
31+ if (! props .frontmatter .image ) {
32+ defineOgImageComponent (' BlogPost' , {
33+ title: props .frontmatter .title ,
34+ authors: post .value ?.authors ?? [],
35+ date: props .frontmatter .date ,
36+ })
37+ }
3538
3639const slug = computed (() => props .frontmatter .slug )
3740
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ tags: ['OpenSource', 'Release']
1111excerpt : " Today we're releasing npmx 0.8 – including a new command palette and a lot of other features."
1212date : ' 2026-04-08'
1313slug : ' release/0.8'
14+ image : ' https://npmx.dev/blog/og/release-0_8.png'
1415description : " Today we're releasing npmx 0.8 – including a new command palette and a lot of other features."
1516draft : false
1617---
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ export const RawBlogPostSchema = object({
4545 excerpt : optional ( string ( ) ) ,
4646 tags : optional ( array ( string ( ) ) ) ,
4747 draft : optional ( boolean ( ) ) ,
48+ image : optional ( string ( ) ) ,
4849} )
4950
5051/** Schema for blog post frontmatter with resolved author data (avatars, profile URLs) */
@@ -58,6 +59,7 @@ export const BlogPostSchema = object({
5859 excerpt : optional ( string ( ) ) ,
5960 tags : optional ( array ( string ( ) ) ) ,
6061 draft : optional ( boolean ( ) ) ,
62+ image : optional ( string ( ) ) ,
6163} )
6264
6365export type Author = InferOutput < typeof AuthorSchema >
You can’t perform that action at this time.
0 commit comments