【问题标题】:How to properly use mainEntityOfPage for a blog details page?如何正确地将 mainEntityOfPage 用于博客详细信息页面?
【发布时间】:2019-02-23 20:29:28
【问题描述】:

我已经阅读了几个关于mainEntityOfPage 是什么以及如何使用它的答案,每个答案都比上一个更令人困惑。

所以我的问题很具体;我有一个包含博客部分的网站。在博客详细信息页面上,我想使用 JSON-LD 格式的结构化数据。

我的问题:我的mainEntityOfPageWebPage 还是BlogPosting

我应该使用这个吗:

<script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "WebPage",
    "mainEntityOfPage": {
        "@type": "BlogPosting",
    }
}
</script>

或者这个:

<script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "BlogPosting",
    "mainEntityOfPage": {
        "@type": "WebPage",
    }
}
</script>

我认为mainEntityOfPageBlogPosting,所以第一个例子,是吗?还是我还是错了?

【问题讨论】:

    标签: blogs schema.org json-ld


    【解决方案1】:

    mainEntityOfPage的定义是:

    表示该事物是被描述的主要实体的页面(或其他 CreativeWork)。

    博客文章页面上的主要实体是博客文章,而不是页面。所以,第二个 sn-p 是正确的:

    {
      "@context": "http://schema.org",
      "@type": "BlogPosting",
      "mainEntityOfPage": {
        "@type": "WebPage"
      }
    }
    

    如果你想使用第一个sn-p(这样WebPage是顶级项),你必须使用mainEntity而不是mainEntityOfPage

    {
      "@context": "http://schema.org",
      "@type": "WebPage",
      "mainEntity": {
        "@type": "BlogPosting"
      }
    }
    

    注1:mainEntitymainEntityOfPage是逆属性,所以这两个sn-ps的意思是一样的。

    注意 2:也许将其解读为“是mainEntityOfPage”和“具有mainEntity”会有所帮助。

    注意 3:您可以在博客文章页面上使用 ItemPage(而不是 WebPage)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-17
      • 1970-01-01
      相关资源
      最近更新 更多