JSON-LD:如何拥有多个articleSection?

我的博客文章可以有很多类别。那么如何在articleSection中添加这些类别?

使用itemprop,您可以这样设置:

<span itemprop="articleSection">Sports</span> -
<span itemprop="articleSection">Politics</span> -
<span itemprop="articleSection">US News</span>

如何使用JSON-LD?

viktors 回答:JSON-LD:如何拥有多个articleSection?

您可以将其作为数组:

"articleSection": [
    "Category 1","Category 2"
]

这是BlogPosting中的完整示例,将在Google Structured Data tool上进行验证:

<script type="application/ld+json">
{
  "@context": "http://schema.org/","@type": "BlogPosting","name": "Apple announces iPhone SE","headline": "Apple phone headline","author": "John Smith","image": "https://example.com/photos/1x1/photo.jpg","publisher": {
    "@type": "Organization","name": "Google","logo": {
      "@type": "ImageObject","url": "https://google.com/logo.jpg"
    }
  },"articleSection": [
    "Category 1","Category 2"
  ],"datePublished": "2016-03-21T11:30:00-07:00","description": "New iPhone announced at 11:30 in California."
}
</script>
本文链接:https://www.f2er.com/3006150.html

大家都在问