使用 JSON-LD 建立文章(Article)資料

分享:
標籤: JSON-LD

要在網站上建立文章類型的 JSON-LD 的資料可以參考以下格式:

{
      "@context": "https://schema.org",
      "@type": "NewsArticle",
      "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://google.com/article"
      },
      "headline": "Article headline",
      "image": [
        "https://example.com/photos/1x1/photo.jpg",
        "https://example.com/photos/4x3/photo.jpg",
        "https://example.com/photos/16x9/photo.jpg"
       ],
      "datePublished": "2015-02-05T08:00:00+08:00",
      "dateModified": "2015-02-05T09:20:00+08:00",
      "author": {
        "@type": "Person",
        "name": "John Doe"
      },
       "publisher": {
        "@type": "Organization",
        "name": "Google",
        "logo": {
          "@type": "ImageObject",
          "url": "https://google.com/logo.jpg"
        }
      }

 

加完後就可以貼到 google 複合式搜尋結果測試看看了。

google 提到如果格式正確的話,有機會在搜尋的時候看到像這樣的內容:

如何在網站上建立 JSON-LD 資料可以看這篇