structured-data-testing-tool
Version:
A library and command line tool to help test for Structured Data.
114 lines (108 loc) • 4.34 kB
HTML
<html>
<head>
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@twitter">
<meta name="twitter:title" content="Title text…">
<meta name="twitter:description" content="Description text…">
<meta name="twitter:creator" content="@twitter">
<meta name="twitter:image" content="http://example.com/image.png">
<meta name="twitter:image:alt" content="Description of image" />
<meta name="twitter:domain" content="example.com">
</head>
<body>
<!-- Microdata -->
<div itemscope itemtype="http://schema.org/Article">
<h1 itemprop="headline">Example Headline in Microdata</h1>
<p>
Author: <span itemprop="author">A Smith</span>
</p>
<p>
Published On: <span itemprop="datePublished">2019-01-01</span>
<p>
<img itemprop="image" src="http://example.com/path-to-article-image.jpg" alt="Image description"/>
<p>
Article text…
</p>
<div itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
<div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
<meta itemprop="url" content="https://www.example.com/logo.png"/>
</div>
<meta itemprop="name" content="ACME"/>
</div>
<link itemprop="url" href="http://example.com/path-to-article"/>
</div>
<!-- Second article with microdata to test handling of multiple instances of the same type -->
<div itemscope itemtype="http://schema.org/Article">
<h1 itemprop="headline">Second Headline in Microdata</h1>
<p>
Author: <span itemprop="author">B Smith</span>
</p>
<p>
Published On: <span itemprop="datePublished">2019-02-01</span>
<p>
<img itemprop="image" src="http://example.com/path-to-article-2-image.jpg" alt="Image description"/>
<p>
Article text…
</p>
<div itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
<div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
<meta itemprop="url" content="https://www.example.com/logo.png"/>
</div>
<meta itemprop="name" content="ACME"/>
</div>
<link itemprop="url" href="http://example.com/path-to-article-2"/>
</div>
<!-- Microdata with itemprop values that specify multiple properties -->
<div itemscope itemtype="http://schema.org/SocialMediaPosting">
<figure itemprop="associatedMedia image" itemscope itemtype="http://schema.org/ImageObject">
<meta itemprop="url" content="http://example.com/path-to-article-image.jpg"/>
</figure>
<meta itemprop="publisher Organization" content="ACME"/>
<p>
Author: <span itemprop="author">A Smith</span>
</p>
</div>
<!-- RDFa -->
<div vocab="http://schema.org/" typeof="NewsArticle">
<h1 property="headline">Example Headline in RDFa</h1>
<p>
Author: <span property="author">B Smith</span>
</p>
<p>
Published On: <span property="datePublished">2019-01-01</span>
<p>
<img property="image" src="http://example.com/path-to-article-image.jpg" alt="Image description"/>
<p>
Article text…
</p>
<div property="publisher" vocab="https://schema.org/" typeof="Organization">
<div property="logo" vocab="https://schema.org/" typeof="ImageObject">
<meta property="url" content="https://www.example.com/logo.png"/>
</div>
<meta property="name" content="ACME"/>
</div>
<link property="url" href="http://example.com/path-to-article"/>
</div>
</div>
<!-- JSON-LD -->
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ReportageNewsArticle",
"headline": "Example Headline in JSON-LD",
"author": "C Smith",
"url": "http://example.com/path-to-article",
"image": "http://example.com/path-to-article-image.jpg",
"datePublished": "2019-01-01",
"publisher": {
"@type": "Organization",
"name": "ACME News",
"logo": {
"@type": "ImageObject",
"url": "https://www.example.com/logo.png"
}
}
}
</script>
</body>
</html>