8

我目前已经像这样实现了我的面包屑:

<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 测试工具时,我收到一条错误消息,指出当前页面面包屑的 url 缺失。

鉴于此,我有三个我能想到的选择。

我为当前页面指定一个 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>

我只显示当前页面标题,而不将其包含在结构化数据标记中:

<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>

你认为我应该怎么做最好?

4

2 回答 2

12

解决方案是使用<meta>标签。

因此,面包屑中的最后一项应如下所示:

<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> <span itemprop="title">CURRENT TITLE</span> <meta itemprop="url" content="CURRENT URL" /> </div>

这将在Google 测试工具上进行验证,并实现您构建有效面包屑而不“显示”冗余链接的预期目标。

供参考:使用微数据开始使用 schema.org

3c。缺失/隐含信息:使用带有内容的元标记

有时,网页有一些有价值的信息需要标记,但由于信息在页面上的显示方式而无法标记...在这些情况下,请使用元标记和内容属性来标记指定信息。

为了完整起见,必须补充一点,根据他们当前的规范,为 Google SERP 提供格式正确的面包屑,您的示例代码应如下所示:

<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb" id="a" itemref="b">
    <a href="HOME URL" itemprop="url">
        <span itemprop="title">HOME TITLE</span>
    </a> 
</div>
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb" id="b" itemprop="child" itemref="c">
    <a href="1ST LEVEL URL" itemprop="url">
        <span itemprop="title">1ST LEVEL TITLE</span>
    </a>
</div>
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb" id="c" itemprop="child">
    <span itemprop="title">CURRENT TITLE</span>
    <meta itemprop="url" content="CURRENT URL" />
</div>

还要记住,Google 面包屑文档很快就会进行审查,因为 Google 似乎终于采用了面包屑的 schema.org 标记,可以从“在搜索结果中更好地呈现 URL ”帖子中推断出在谷歌官方网站管理员中心博客和讨论中。

于 2015-04-23T14:07:36.093 回答
0

我会选择只显示标题,当前级别不包含在标记中,如下所示。恕我直言,您不必在面包屑中包含当前页面,因为 SERP 无论如何都会指向当前页面。从比当前页面高一级提供面包屑是有意义的。希望这可以帮助。顺便说一句,我们已经在我们的组织中做到了。

<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>
于 2015-04-23T13:32:36.107 回答