我正在尝试用微数据设置一首歌的duration。在微数据中描述持续时间的最佳方法是什么?
是通过在itemprop="duration"中使用span实现的吗?
<span itemprop="duration" content="PT4M5S">4:05</span>还是使用time元素?
<time itemprop="duration" datetime="PT4M5S">4:05</time>还是使用meta元素?
<meta itemprop="duration" content="PT4M5S"/>4:05或者是他们所有的组合?
<span itemprop="duration" content="PT4M5S">
<time itemprop="duration" datetime="PT4M5S">
<meta itemprop="duration" content="PT4M5S"/>4:05
</time>
</span>我试过了,他们都在Google的结构化数据测试工具中工作,除了最后一个测试结果是三个持续时间!
发布于 2015-06-14 20:56:01
duration属性期望一个Duration作为值,这个值必须在ISO 8601期限格式中。
time元素可以有一个"有效持续时间字符串“作为值(它基于ISO8601格式之一)。您的值"PT4M5S“将有效。
所以你应该用
<time itemprop="duration" datetime="PT4M5S">4:05</time>微数据解析器必须使用值的datetime属性(如果存在)。
(只有在无法标记可见内容的情况下,才应该使用meta元素。)
发布于 2013-07-04 08:27:20
完整的细节以及示例可以在音乐录制模式上查看。
具体来说,以下是这类数据的正确标记:-
<div itemscope itemtype="http://schema.org/MusicGroup">
<h1 itemprop="name">Foo Fighters</h1>
<div itemprop="video" itemscope itemtype="http://schema.org/VideoObject">
<h2>Video: <span itemprop="name">Interview with the Foo Fighters</span></h2>
<meta itemprop="duration" content="T1M33S" />
<meta itemprop="thumbnail" content="foo-fighters-interview-thumb.jpg" />
<object ...>
<param ...>
<embed type="application/x-shockwave-flash" ...>
</object>
<span itemprop="description">Catch this exclusive interview with
Dave Grohl and the Food Fighters about their new album, Rope.</span>
</div>
<h2>Songs</h2>
<div itemprop="track" itemscope itemtype="http://schema.org/MusicRecording">
<span itemprop="name">Rope</span>
<meta itemprop="url" content ="foo-fighters-rope.html">
Length: <meta itemprop="duration" content="PT4M5S">4:05 -
14300 plays<meta itemprop="interactionCount" content="UserPlays:14300" />
<a href="foo-fighters-rope-play.html" itemprop="audio">Play</a>
<a href="foo-fighters-rope-buy.html" itemprop="offers">Buy</a>
From album: <a href="foo-fighters-wasting-light.html"
itemprop="inAlbum">Wasting Light</a>
</div>
<div itemprop="track" itemscope itemtype="http://schema.org/MusicRecording">
<span itemprop="name">Everlong</span>
<meta itemprop="url" content ="foo-fighters-everlong.html">
Length: <meta itemprop="duration" content="PT6M33S">6:33 -
<span itemprop="playCount">11700</span> plays
<a href="foo-fighters-everlong-play.html" itemprop="audio">Play</a>
<a href="foo-fighters-everlong-buy.html" itemprop="offers">Buy</a>
From album: <a href="foo-fighters-color-and-shape.html"
itemprop="inAlbum">The Color And The Shape</a>
</div>
<h2>Upcoming shows</h2>
<div itemprop="event" itemscope itemtype="http://schema.org/Event">
<a href="foo-fighters-may20-fedexforum" itemprop="url">
<span itemprop="name">FedExForum</span>
</a>
<span itemprop="location">Memphis, TN, US</span>
<meta itemprop="startDate" content="2011-05-20">May 20
<a href="ticketmaster.com/foofighters/may20-2011" itemprop="offers">Buy tickets</a>
</div>
<div itemprop="event" itemscope itemtype="http://schema.org/Event">
<a href="foo-fighters-may23-midamericacenter" itemprop="url">
<span itemprop="name">Mid America Center</span>
</a>
<span itemprop="location">Council Bluffs, IA, US</span>
<meta itemprop="startDate" content="2011-05-23">May 23
<a href="ticketmaster.com/foofighters/may23-2011" itemprop="offers">Buy tickets</a>
</div>
<h2><a href="foo-fighters-photos">28 Photos</a></h2>
<a href="foofighters-1.jpg" itemprop="image"><img src="foofighters-thumb1.jpg" /></a>
<a href="foofighters-2.jpg" itemprop="image"><img src="foofighters-thumb2.jpg" /></a>
<a href="foofighters-3.jpg" itemprop="image"><img src="foofighters-thumb3.jpg" /></a>
<h2>Comments:</h2>
Excited about seeing them in concert next week. -Lawrence , Jan 23
I dig their latest single. -Mary, Jan 19
<meta itemprop="interactionCount" content="UserComments:18" />
Showing 1-2 of 18 comments. <a href="foofighters-comments">More</a>
</div>https://webmasters.stackexchange.com/questions/50358
复制相似问题