File tree 3 files changed +21
-2
lines changed
3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 6
6
imageType: ' image/jpeg' ,
7
7
imageWidth: 800 ,
8
8
imageHeight: 511 ,
9
+ type: ' article' ,
10
+ published: ' 2024-01-21' ,
9
11
});
10
12
11
13
// https://search.google.com/test/rich-results
Original file line number Diff line number Diff line change 3
3
<url >
4
4
<loc >https://jdw.me/</loc >
5
5
</url >
6
+ <url >
7
+ <loc >https://jdw.me/blog</loc >
8
+ </url >
9
+ <url >
10
+ <loc >https://jdw.me/blog/just-do-something-literally-anything</loc >
11
+ </url >
6
12
<url >
7
13
<loc >https://jdw.me/resume</loc >
8
14
</url >
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ export default ({
6
6
imageType = 'image/png' ,
7
7
imageWidth = 600 ,
8
8
imageHeight = 600 ,
9
+ author = 'Jonathan Walters' ,
10
+ published,
9
11
type = 'website' ,
10
12
} = { } ) => {
11
13
const route = useRoute ( ) ;
@@ -22,7 +24,7 @@ export default ({
22
24
] ,
23
25
} ) ;
24
26
25
- useSeoMeta ( {
27
+ const seoMeta = {
26
28
title : pageTitle ?? title ,
27
29
colorScheme : 'only light' ,
28
30
themeColor : '#60a5fa' ,
@@ -40,5 +42,14 @@ export default ({
40
42
twitterTitle : title ,
41
43
twitterSite : '@chalksy' ,
42
44
twitterImage : imageUrl ,
43
- } ) ;
45
+ } ;
46
+
47
+ if ( type === 'article' ) {
48
+ seoMeta . articleAuthor = author ;
49
+ if ( published ) {
50
+ seoMeta . articlePublishedTime = published ;
51
+ }
52
+ }
53
+
54
+ useSeoMeta ( seoMeta ) ;
44
55
} ;
You can’t perform that action at this time.
0 commit comments