Merge branch 'feat/jsonld-categories'

This commit is contained in:
Sam Carlton 2021-03-26 15:15:07 -05:00
commit aed6004f81
2 changed files with 21 additions and 3 deletions

View file

@ -59,7 +59,7 @@
</template>
<script>
import { lastUpdatedFriendly } from '~/helpers/parse-date'
import { makeLastUpdatedFriendly } from '~/helpers/parse-date'
import { getAppEndpoint } from '~/helpers/app-derived.js'
import LinkButton from '~/components/link-button.vue'
@ -105,7 +105,7 @@ export default {
},
computed: {
lastUpdatedFriendly () {
return lastUpdatedFriendly( this.app.lastUpdated )
return makeLastUpdatedFriendly( this.app.lastUpdated )
}
},
head() {

View file

@ -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' }]
}
}
}