将ItemLists中的结构化数据/微数据重构为“简单”的ListItem

Discourse 在多个地方使用微数据 ItemLists 和 ListItems。

其中一些 ListItems 仅仅是实际对象的引用/链接,本身并不代表一个对象。请参阅 ItemLists:

  • Crawler-View:Category-View → “topic-list”
  • Crawler-View:Topic-View → 第一个帖子 → “crawler-linkback-list”

由于这些 ListItems 仅仅是引用,我们可以将包含它们的 ItemLists 称为“摘要”。
对于“摘要”,Google 建议使用“简单”的 List:

请参阅:Carousel (ItemList) Structured Data | Google Search Central  |  Documentation  |  Google for Developers

Google 可能会将具有更多属性的“复杂”ListItem 视为一个独立的对象——从而在 List 页面上引入新对象,而不是仅仅引用原始对象(URL)。


例如 Crawler-View:Category-View → “topic-list”

“复杂”列表 - 当前状态

<div itemscope="" itemtype="http://schema.org/ItemList">
  <meta itemprop="itemListOrder" content="http://schema.org/ItemListOrderDescending">
  <table class="topic-list">
    [...]
    <tbody class="topic-list-body">
        [...]
        <tr class="topic-list-item">
          <td class="main-link topic-list-data" itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem">
            <meta itemprop="name" content="Remove wrong structured data from every subpage – add &quot;Sitelinks Search Box&quot; to the homepage only">
            <meta itemprop="url" content="https://meta.discourse.org/t/remove-wrong-structured-data-from-every-subpage-add-sitelinks-search-box-to-the-homepage-only/219299">
              <meta itemprop="image" content="https://d11a6trkgmumsb.cloudfront.net/optimized/3X/6/8/68d84f5836ecc992fe21d08e05225eb57e47da38_2_1024x778.png">
            <meta itemprop="position" content="2">
            [...]
        </tr>
        [...]
    </tbody>
  </table>
</div>

“简单”列表 - 伪代码

<div itemscope="" itemtype="http://schema.org/ItemList">
  <table class="topic-list">
    [...]
    <tbody class="topic-list-body">
        [...]
        <tr class="topic-list-item">
          <td class="main-link topic-list-data" itemscope="" itemtype="http://schema.org/ListItem">
            <meta itemprop="url" content="https://meta.discourse.org/t/remove-wrong-structured-data-from-every-subpage-add-sitelinks-search-box-to-the-homepage-only/219299">
            <meta itemprop="position" content="2">
            [...]
        </tr>
        [...]
    </tbody>
  </table>
</div>
2 个赞

我很乐意改进这里的东西,有兴趣的话可以提交一个 PR。

1 个赞

PR for Crawler-View:Category-View → “topic-list”

1 个赞

PR for Crawler-View:Topic-View → first post → “crawler-linkback-list”


当前状态 - 请参阅 https://search.google.com/test/rich-results/result?id=rZ2rScT4qsLi5K8uwJDtUQ&hl=en

应用 PR 后 - 请参阅 https://search.google.com/test/rich-results/result?id=lJrsyBggKH6Cx5FPH65rXg&hl=en

Google 将实际类型 DiscussionForumPosting - Schema.org Type 重新排序为其父类型 Article
ThingCreativeWorkArticleSocialMediaPostingDiscussionForumPosting

缺少的 18 个 Articles 实际上仅是对 Articles 的引用,并在新的 Carousel 中列出。
例如,请参阅 Kanban Board

1 个赞