Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit e4f6fee

Browse files
author
Je
committed
fix: improve SEO component
1 parent 88c553a commit e4f6fee

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

head.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,16 @@ interface SEOProps {
7676
title?: string
7777
description?: string
7878
keywords?: string | string[]
79+
url?: string
7980
image?: string
81+
twitter?: {
82+
card?: 'summary' | 'summary_large_image' | 'app' | 'player'
83+
site?: string
84+
creator?: string
85+
}
8086
}
8187

82-
export function SEO({ title, description, keywords, image }: SEOProps) {
88+
export function SEO({ title, description, keywords, url, image, twitter }: SEOProps) {
8389
return createElement(
8490
Head,
8591
undefined,
@@ -90,9 +96,12 @@ export function SEO({ title, description, keywords, image }: SEOProps) {
9096
description && createElement('meta', { name: 'og:description', content: description }),
9197
title && createElement('meta', { name: 'twitter:title', content: title }),
9298
description && createElement('meta', { name: 'twitter:description', content: description }),
99+
url && createElement('meta', { name: 'og:url', content: url }),
93100
image && createElement('meta', { name: 'og:image', content: image }),
94-
image && createElement('meta', { name: 'twitter:image:src', content: image }),
95-
image && createElement('meta', { name: 'twitter:card', content: 'summary_large_image' }),
101+
image && createElement('meta', { name: 'twitter:image', content: image }),
102+
image && createElement('meta', { name: 'twitter:card', content: twitter?.card || 'summary_large_image' }),
103+
twitter?.site && createElement('meta', { name: 'twitter:site', content: twitter.site }),
104+
twitter?.creator && createElement('meta', { name: 'twitter:creator', content: twitter.creator }),
96105
)
97106
}
98107

0 commit comments

Comments
 (0)