File tree Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -250,6 +250,7 @@ export function NotionPage({
250250 description = { socialDescription }
251251 image = { socialImage }
252252 url = { canonicalPageUrl }
253+ isBlogPost = { isBlogPost }
253254 />
254255
255256 { isLiteMode && < BodyClassName className = 'notion-lite' /> }
Original file line number Diff line number Diff line change @@ -10,12 +10,14 @@ export function PageHead({
1010 description,
1111 pageId,
1212 image,
13- url
13+ url,
14+ isBlogPost
1415} : types . PageProps & {
1516 title ?: string
1617 description ?: string
1718 image ?: string
1819 url ?: string
20+ isBlogPost ?: boolean
1921} ) {
2022 const rssFeedUrl = `${ config . host } /feed`
2123
@@ -99,6 +101,41 @@ export function PageHead({
99101 < meta property = 'og:title' content = { title } />
100102 < meta name = 'twitter:title' content = { title } />
101103 < title > { title } </ title >
104+
105+ { /* Better SEO for the blog posts */ }
106+ { isBlogPost && (
107+ // See more here: https://schema.org/BlogPosting
108+ < script type = "application/ld+json" >
109+ { JSON . stringify ( {
110+ "@context" : "https://schema.org" ,
111+ "@type" : "BlogPosting" ,
112+ "@id" : `${ url } #BlogPosting` ,
113+ "mainEntityOfPage" : url ,
114+ url,
115+ "headline" : title ,
116+ "name" : title ,
117+ description,
118+ "author" : {
119+ "@type" : "Person" ,
120+ // TODO: Google Rich Search results recommends adding the url:
121+ // "url": "..."
122+ "name" : config . author ,
123+ } ,
124+ "image" : socialImageUrl ,
125+ // TODO: Figure out how to pull these from the Notion content
126+ //"datePublished": "2024-11-08",
127+ //"dateModified": "2024-11-08",
128+ //"wordCount": "488",
129+ //"keywords": [
130+ // "tags",
131+ // "should",
132+ // "be"
133+ // "here"
134+ //],
135+ //"articleBody": "..."
136+ } ) }
137+ </ script >
138+ ) }
102139 </ Head >
103140 )
104141}
You can’t perform that action at this time.
0 commit comments