Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Nuxt: Add JSON-LD schema markup for SEO in Nuxt.js
data(){
return ({
description:'Description of the site'
})
}
head(){
return({
title: 'Home page',
meta: [
{
hid: 'description',
name: 'description',
content: `${this.description}`
}
],
script:[{
type:'application/ld+json',
json: {
'@context': 'http://schema.org',
'@type': <<Type gotten from Schema.org>>,
// Remaining properties
}
}]
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment