【问题标题】:Google Structure Data Breadcrumb Markup谷歌结构化数据面包屑标记
【发布时间】:2017-06-05 11:28:39
【问题描述】:

我正在尝试为 Google 结构数据实现面包屑导航,以下是我尝试构建的内容。

首页 > 分类 > 页面名称

当我的经理提出语法建议时,问题就开始了。

这是我的经理建议的。

<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
  <a href="https://www.example.com" itemprop="url">
    <span itemprop="title">Home</span>
  </a> >
</div>  

<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
  <a href=" https://www.example.com/blog" itemprop="url">
    <span itemprop="title">Category</span>
  </a> >
</div>  

<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
  <a href=" https://www.example.com/blog/can-work-pregnant/" itemprop="url">
    <span itemprop="title">Page Name</span></a>
</div>  

这是我认为是正确的。

<div itemscope itemtype="http://schema.org/BreadcrumbList">
  <span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
    <a itemscope itemtype="http://schema.org/Thing" itemprop="item" href="https://example.com/">
        <span itemprop="name">Home</span></a>
        <meta itemprop="position" content="1" />
  </span>
  <span class="seperator">></span>
  <span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
    <a itemscope itemtype="http://schema.org/Thing" itemprop="item" href="https://example.com/category">
      <span itemprop="name">Category</span></a>
      <meta itemprop="position" content="2" />
      </span>
      <span class="seperator">›</span>
    <span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
    <a itemscope itemtype="http://schema.org/Thing" itemprop="item" href="https://example.com/category/page">
      <span itemprop="name">Page Name</span></a>
      <meta itemprop="position" content="3" />
  </span>
</div>

如果您尝试这两种语法,您会看到第一个创建了 3 个单独的面包屑,而不是一个包含完整数据的面包屑。

但由于这是我的经理建议的,除非我有充分的理由,否则我不想拒绝它。

所以,我想知道的是使用第一种语法的优缺点。请帮我。提前致谢。

【问题讨论】:

    标签: html google-search-console structured-data


    【解决方案1】:

    你的方法是正确的。它产生一个 3 级的面包屑路径。你的经理不正确。他们的方式制作了 3 条不同的“小径”,每条都只有一层。如果只有一项就不是踪迹。

    【讨论】:

      猜你喜欢
      • 2015-01-01
      • 1970-01-01
      • 2016-08-26
      • 1970-01-01
      • 1970-01-01
      • 2013-08-25
      • 2020-02-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多