Test that structured data markup is valid

This commit is contained in:
Sam Carlton 2022-07-06 14:00:05 -05:00
parent 3679a8080b
commit 3c10d420f8
2 changed files with 75 additions and 2 deletions

View file

@ -311,13 +311,22 @@ export class PageHead {
}
get structuredDataMarkup () {
// console.log( 'this.structuredData', this.structuredData )
if ( structuredData === null ) return ''
if ( this.structuredData === null ) return ''
const structuredDataJson = JSON.stringify( structuredData )
const structuredDataJson = JSON.stringify( this.structuredData )
return `<script type="application/ld+json">${ structuredDataJson }</script>`
}
get allHeadMarkup () {
return [
this.metaMarkup,
this.linkMarkup,
this.structuredDataMarkup
].join('')
}
}