我正在尝试使用Google的Structured Data Testing Tool使我的文章页面具有有效的RDFa。我无法让它接受组织徽标。它总是抱怨“ URL字段的值是必需的”。我尝试将徽标url添加为“ url”,“ src”和“ content”,如下所示。香港专业教育学院也试图把一个实际的<img>
标签与property =“ logo”,在那里,但我不能摆脱错误信息。有人解决了吗?
<div vocab="http://schema.org/" typeof="Article">
<h1 property="headline name">My Amazing Article Title</h1>
<meta property="articleSection" content="Sports" />
<meta property="image" content="https://www.example.com/image.jpg" />
<meta property="datePublished dateModified" content="2020-01-13" />
<span property="author publisher" typeof="Organization">
<meta property="name" content="MyCompanyName" />
<meta property="logo" src="https://www.example.com/logo.png" url="https://www.example.com/logo.png" content="https://www.example.com/logo.png" />
<meta property="url" content="https://www.example.com/" />
</span>
<div property="articleBody">
Bla bla bla
</div>
</div>
要查看确切的错误,您可以将以上代码段复制并粘贴到Google的工具中,以查看我看到的内容。顺便说一句,如果我完全省略徽标,Google会抱怨需要徽标。
答案:
<div vocab="http://schema.org/" typeof="Article">
<h1 property="headline name">My Amazing Article Title</h1>
<meta property="articleSection" content="Sports" />
<meta property="image" content="https://www.example.com/image.jpg" />
<meta property="datePublished dateModified" content="2020-01-13" />
<span property="author publisher" typeof="Organization">
<meta property="name" content="MyCompanyName" />
<span property="logo" typeof="ImageObject">
<meta property="url" content="https://www.example.com/logo.png" />
</span>
<meta property="url" content="https://www.example.com/" />
</span>
<div property="articleBody">
Bla bla bla
</div>
</div>