From d604c50d3ac5f06e2b7257af2d993f991ffbcc08 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Fri, 26 Mar 2021 14:49:35 -0500 Subject: [PATCH] Add faq structured data to kind pages --- pages/kind/_slug.vue | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/pages/kind/_slug.vue b/pages/kind/_slug.vue index 5a8fc38..8c1090a 100644 --- a/pages/kind/_slug.vue +++ b/pages/kind/_slug.vue @@ -146,6 +146,22 @@ export default { description () { return `Check the the latest reported support status of ${this.pluralLabel || this.category.label} on Apple Silicon and Apple M1 Processors. ` }, + structuredData () { + return { + "@context": "https://schema.org", + "@type": "FAQPage", + "mainEntity": this.categoryAppList.map( app => { + return { + "@type": "Question", + "name": `Does ${app.name} work on Apple Silicon and Apple M1 Macs?`, + "acceptedAnswer": { + "@type": "Answer", + "text": app.text + } + } + }) + } + } }, head() { return { @@ -173,7 +189,9 @@ export default { 'property': 'twitter:url', 'content': `${process.env.URL}${this.$nuxt.$route.path}` }, - ] + ], + __dangerouslyDisableSanitizers: ['script'], + script: [{ innerHTML: JSON.stringify(this.structuredData), type: 'application/ld+json' }] } } }