@@ -12,7 +12,9 @@ export const Head = component$(() => {
12
12
13
13
return (
14
14
< head >
15
- < title > { head . title } </ title >
15
+ < title >
16
+ { location . url . pathname === '/' ? head . title : `${ head . title } | Valibot` }
17
+ </ title >
16
18
17
19
< meta charSet = "utf-8" />
18
20
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" />
@@ -27,6 +29,20 @@ export const Head = component$(() => {
27
29
< link rel = "apple-touch-icon" sizes = "180x180" href = "/icon-180px.jpg" />
28
30
< link rel = "manifest" href = "/manifest.json" />
29
31
32
+ < meta
33
+ property = "og:image"
34
+ content = {
35
+ location . url . pathname === '/'
36
+ ? '/og-image'
37
+ : `/og-image?title=${ encodeURIComponent (
38
+ head . title
39
+ ) } &description=${ encodeURIComponent (
40
+ head . meta . find ( ( item ) => item . name === 'description' )
41
+ ?. content || ''
42
+ ) } `
43
+ }
44
+ />
45
+
30
46
< script
31
47
async
32
48
src = "https://umami.valibot.dev/script.js"
@@ -41,20 +57,8 @@ export const Head = component$(() => {
41
57
< script dangerouslySetInnerHTML = "document.documentElement.classList.remove('dark')" />
42
58
) }
43
59
44
- { [ ...head . meta , ...( head . frontmatter . meta || [ ] ) ] . map (
45
- ( { key, ...props } ) => (
46
- < meta key = { key } { ...props } />
47
- )
48
- ) }
49
-
50
- { /* TODO: Check if we really need this code */ }
51
- { head . links . map ( ( { key, ...props } ) => (
52
- < link key = { key } { ...props } />
53
- ) ) }
54
-
55
- { /* TODO: Check if we really need this code */ }
56
- { head . styles . map ( ( { key, style, ...props } ) => (
57
- < style key = { key } { ...props } dangerouslySetInnerHTML = { style } />
60
+ { head . meta . map ( ( { key, ...props } ) => (
61
+ < meta key = { key } { ...props } />
58
62
) ) }
59
63
</ head >
60
64
) ;
0 commit comments