File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
blog/src/theme/BlogPostPage Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,37 @@ const BlogPostPage = (props: Props): JSX.Element => {
133133 { tags . length > 0 && (
134134 < meta property = "article:tag" content = { tags . map ( ( tag ) => tag . label ) . join ( ',' ) } />
135135 ) }
136+ < script type = "application/ld+json" >
137+ { JSON . stringify ( {
138+ '@context' : 'https://schema.org' ,
139+ '@type' : 'BlogPosting' ,
140+ headline : title ,
141+ description,
142+ datePublished : date ,
143+ ...( image && { image } ) ,
144+ author : authors . map ( ( author ) => ( {
145+ '@type' : 'Person' ,
146+ name : author . name ,
147+ ...( author . url && { url : author . url } ) ,
148+ ...( author . imageURL && { image : author . imageURL } ) ,
149+ } ) ) ,
150+ ...( tags . length > 0 && {
151+ keywords : tags . map ( ( tag ) => tag . label ) . join ( ', ' ) ,
152+ } ) ,
153+ publisher : {
154+ '@type' : 'Organization' ,
155+ name : 'Apache APISIX' ,
156+ logo : {
157+ '@type' : 'ImageObject' ,
158+ url : 'https://apisix.apache.org/img/logo2.svg' ,
159+ } ,
160+ } ,
161+ mainEntityOfPage : {
162+ '@type' : 'WebPage' ,
163+ '@id' : metadata . permalink ,
164+ } ,
165+ } ) }
166+ </ script >
136167 </ Seo >
137168
138169 < BlogPostItem frontMatter = { frontMatter } assets = { assets } metadata = { metadata } isBlogPostPage >
You can’t perform that action at this time.
0 commit comments