File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -24,20 +24,29 @@ export function preprocessHead<T extends Frontmatter>(frontmatter: T, options: R
24
24
if ( head . title ) {
25
25
if ( ! meta . find ( ( i : any ) => i . property === 'og:title' ) )
26
26
meta . push ( { property : 'og:title' , content : head . title } )
27
+
28
+ if ( ! meta . find ( ( i : any ) => i . name === 'twitter:title' ) )
29
+ meta . push ( { name : 'twitter:title' , content : head . title } )
27
30
}
28
31
29
32
if ( head . description ) {
33
+ if ( ! meta . find ( ( i : any ) => i . name === 'description' ) )
34
+ meta . push ( { name : 'description' , content : head . description } )
35
+
30
36
if ( ! meta . find ( ( i : any ) => i . property === 'og:description' ) )
31
37
meta . push ( { property : 'og:description' , content : head . description } )
32
38
33
- if ( ! meta . find ( ( i : any ) => i . name === 'description' ) )
34
- meta . push ( { name : 'description' , content : head . description } )
39
+ if ( ! meta . find ( ( i : any ) => i . name === 'twitter: description' ) )
40
+ meta . push ( { name : 'twitter: description' , content : head . description } )
35
41
}
36
42
37
43
if ( head . image ) {
38
44
if ( ! meta . find ( ( i : any ) => i . property === 'og:image' ) )
39
45
meta . push ( { property : 'og:image' , content : head . image } )
40
46
47
+ if ( ! meta . find ( ( i : any ) => i . name === 'twitter:image' ) )
48
+ meta . push ( { name : 'twitter:image' , content : head . image } )
49
+
41
50
if ( ! meta . find ( ( i : any ) => i . property === 'twitter:card' ) )
42
51
meta . push ( { name : 'twitter:card' , content : 'summary_large_image' } )
43
52
}
You can’t perform that action at this time.
0 commit comments