Nuxt3 设置 schema.org 进行SEO优化
Published on
Schema.org 是一个由 Google、Microsoft、Yahoo! 和 Yandex 等搜索引擎合作发起的项目,旨在创建和维护一个通用的结构化数据标记词汇表,帮助搜索引擎更好地理解网站上的内容。
下面说说 Nuxt3 如何设置
useHead({
script: [
{
type: 'application/ld+json',
innerHTML: JSON.stringify({
"@context": "https://schema.org/",
"@type": "Product",
"name": "Example Product",
"image": [
"https://example.com/photos/1x1/photo.jpg",
"https://example.com/photos/4x3/photo.jpg",
"https://example.com/photos/16x9/photo.jpg"
],
"description": "A high-quality example product.",
"brand": {
"@type": "Brand",
"name": "Example Brand"
},
"offers": {
"@type": "Offer",
"url": "https://example.com/example-product",
"priceCurrency": "USD",
"price": "99.99",
"availability": "https://schema.org/InStock"
}
})
],
})
Schema.org 官网: https://schema.org/
Google Search Central 文档: https://developers.google.com/search/docs/appearance/structured-data
Google 富媒体搜索结果测试工具: https://search.google.com/test/rich-results