请解释我应该将 Schema.org 的哪些微数据用于用户页面?
这是我感兴趣的页面的一个小示例:
<body itemscope="itemscope" itemtype="http://schema.org/ProfilePage">
<div itemtype="http://schema.org/Person" itemscope>
<h2 class="vcard-names">
<span itemprop="name" class="user-name">John Doe</span>
<em itemprop="additionalName" class="user-nick">admin</em>
</h2>
<div class="vcard-details">
<dl title="Email">
<dd>
<a class="email" data-email="john@doe.com" href="mailto:john@doe.com">john@doe.com</a>
</dd>
</dl>
<dl title="Home Page">
<dd>
<a href="http://doe.com" itemprop="url">http://doe.com</a>
</dd>
</dl>
<dl title="Birthday">
<dd>
<time itemprop="birthDate" content="1983-05-16T00:00:00+0000" datetime="1983-05-16T00:00:00+0000">
Monday, May 16, 1983
</time>
</dd>
</dl>
<dl title="User groups">
<dd class="tagcloud">
<span>Approved</span>
<span>Users</span>
<span>Admins</span>
</dd>
</dl>
<div class="user-bio">
<h4>Bio</h4>
<p itemprop="about">
Inquisitive Developer, Bloger, Avid Reader, Music Lover, Gamer;
</p>
</div>
</div>
</div>
- 我应该使用
<body>
吗?标记为 itemtype="http://schema.org/ProfilePage"? - 我应该使用
<div>
吗?带有 itemtype="http://schema.org/Person"的标签如果我使用<body>
标记为 itemtype="http://schema.org/ProfilePage"? - 请看一下这个标记示例。我对这个概念的理解是否正确?
最佳答案
在您的示例中,ProfilePage
和 Person
没有任何关系。
您可以使用 mainEntity
将 Person
与 ProfilePage
链接起来的属性:
<body itemscope itemtype="http://schema.org/ProfilePage">
<div itemprop="mainEntity" itemscope itemtype="http://schema.org/Person">
</div>
</body>
这表示 Person
是此 ProfilePage
上描述的主要实体。此外,您还可以使用 about
(即 itemprop="about mainEntity"
)。
您当前的 itemprop="about"
嵌套在 Person
项下,但是 about
property没有为 Person
定义。如果您认为它是对人物的描述,则可以改用 description
属性。
关于html - Schema.org 项目类型 Person 与 ProfilePage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20325291/