我目前实现了像这样的面包屑:
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="HOME URL" itemprop="url">
<span itemprop="title">HOME TITLE</span>
</a> >
</div>
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="1ST LEVEL URL" itemprop="url">
<span itemprop="title">1ST LEVEL TITLE</span>
</a> >
</div>
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<span itemprop="title">CURRENT TITLE</span>
</div>
如您所见,我没有为当前页面指定一个URL,这将是多余的 . 但是当我尝试Google testing tool时,我收到错误,说当前页面痕迹的网址丢失了 .
鉴于此,我有三个选择,我可以想到 .
我为当前页面指定了一个url:
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="HOME URL" itemprop="url">
<span itemprop="title">HOME TITLE</span>
</a> >
</div>
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="1ST LEVEL URL" itemprop="url">
<span itemprop="title">1ST LEVEL TITLE</span>
</a> >
</div>
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="CURRENT LEVEL URL" itemprop="url">
<span itemprop="title">CURRENT TITLE</span>
</a>
</div>
我只是显示当前页面 Headers 而不将其包含在结构化数据标记中:
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="HOME URL" itemprop="url">
<span itemprop="title">HOME TITLE</span>
</a> >
</div>
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="1ST LEVEL URL" itemprop="url">
<span itemprop="title">1ST LEVEL TITLE</span>
</a> >
</div>
<span>CURRENT TITLE</span>
我没有在面包屑中显示当前级别(我不想这样做,我必须说):
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="HOME URL" itemprop="url">
<span itemprop="title">HOME TITLE</span>
</a> >
</div>
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="1ST LEVEL URL" itemprop="url">
<span itemprop="title">1ST LEVEL TITLE</span>
</a>
</div>
您认为我应该做什么最好?
2 回答
解决方案是使用
<meta>
标记 .因此,您的痕迹中的最后一项应如下所示:
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> <span itemprop="title">CURRENT TITLE</span> <meta itemprop="url" content="CURRENT URL" /> </div>
这将验证Google testing tool并实现您的目标,即构建一个有效的痕迹,而不需要"displaying"冗余链接 .
供参考:Getting started with schema.org using Microdata
为了完整起见,必须添加一个适用于Google SERP的格式正确的痕迹,根据他们当前的specs,您的示例代码应如下所示:
请记住,谷歌面包屑文档很快就要进行审核了,因为谷歌最近采用了schema.org标记来获取面包屑,这可以从Google官方网站管理员中心的“Better presentation of URLs in search results”帖子中推断出来 . 博客和讨论 .
我会选择只显示 Headers ,当前级别不包括在标记中,如下所示 . 恕我直言,你不必在面包屑中包含当前页面,因为SERP无论如何都指向当前页面 . 从高于当前页面的一个级别提供面包屑是有意义的 . 希望这可以帮助 . 顺便说一句,我们已经在我们的组织中做到了这一点 .