首页 > 解决方案 > 多门课程需要 JSON-LD 结构化数据示例

问题描述

我参考了Google 给出的以下示例:

<html>
  <head>
    <title>Introduction to Computer Science and Programming</title>
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "Course",
      "name": "Introduction to Computer Science and Programming",
      "description": "Introductory CS course laying out the basics.",
      "provider": {
        "@type": "Organization",
        "name": "University of Technology - Eureka",
        "sameAs": "http://www.ut-eureka.edu"
      }
    }
    </script>
  </head>
  <body>
  </body>
</html>

但我有一个包含软技能课程列表的页面。谷歌也给出了一个叫做的东西ItemList,但没有给出如何将它与Course. 如何在 JSON-LD 中指定多个 Courses 结构化数据?谢谢!

标签: json-ldstructured-data

解决方案


我遇到过同样的问题。像这样再打开一个脚本就足够了:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Course",
  "name": "Introduction to Computer Science and Programming",
  "description": "Introductory CS course laying out the basics.",
  "provider": {
    "@type": "Organization",
    "name": "University of Technology - Eureka",
    "sameAs": "http://www.ut-eureka.edu"
  }
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Course",
  "name": "Introduction to Computer Science and Programming",
  "description": "Introductory CS course laying out the basics.",
  "provider": {
    "@type": "Organization",
    "name": "University of Technology - Eureka",
    "sameAs": "http://www.ut-eureka.edu"
  }
}
</script>

推荐阅读