【问题标题】:News item in Schema.orgSchema.org 中的新闻项目
【发布时间】:2015-01-14 06:00:13
【问题描述】:

我目前正在为一个网站制作新闻页面。由于我在 http://schema.org/ 上没有找到任何新闻示例,我想知道最好的 Schema.org 类型是什么?

<li>
  <time>2015-12-31<time>
  <div>
    <h2>News title</h2>
    <div class="content">Lorem Ipsum</div>
  </div>
</li>

我还要麻烦添加微数据吗?

我目前拥有的:

<li itemscope itemtype="http://schema.org/Article">
  <time itemprop="datePublished">2015-12-31<time>
  <div>
    <h2 itemprop="headline">News title</h2>
    <div class="content" itemprop="description">Lorem Ipsum</div>
  </div>
</li>

Article 合适吗?
我应该使用headline 还是name
我应该使用description 还是articleBody

【问题讨论】:

  • 我会使用 HTML5 与此组合。当您可以将article 标记用于新闻项目时,请勿使用 div。
  • 我没有使用article,因为li 已经在article 标记中。我应该把文章放在文章中吗?

标签: html schema.org microdata


【解决方案1】:

Schema.org type Article 是合适的,正如它的描述所说(粗体强调我的):

一篇文章,例如一篇新闻文章或一篇调查报告。 […]

但您甚至可以通过使用NewsArticle type 来更具体(请注意,通过使用这种类型,您的新闻帖子是alsoArticle也是 一个CreativeWork 和也是Thing,所以你不会“错过”任何东西)。

关于descriptionarticleBody:就像他们的描述所说,您可以使用description 作为“简短描述”,使用articleBody 作为新闻文章的“正文”。

关于nameheadline:它们通常具有相同的内容,因此如果您不知道/不需要这种差异,您可以使用both (itemprop="headline name") 或直接使用@ 987654342@(因为这是每个项目/Thing 可以拥有的,而headline 是仅对CreativeWork 的补充)。

它与微数据无关,但您可能希望在此列表中的每个新闻帖子中使用 article 元素。如果它是一个列表,例如,最近的新闻帖子,父 should probably not be article but section

<section>
  <h1>Recent news posts</h1>
  <ul>
    <li><article><!-- news post 1 --></article></li>
    <li><article><!-- news post 2 --></article></li>
  </ul>
</section>

article 可能看起来像:

<li>
  <article itemscope itemtype="http://schema.org/NewsArticle">
    <header>
      <time itemprop="datePublished">2015-12-31<time>
      <h2 itemprop="name">News title</h2>
    </header>

    <div itemprop="description"><!-- news teaser --></div>
    <!-- or "articleBody" instead of "description" if it’s the full content -->

  </article>
</li>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-04-08
    • 2017-03-02
    • 2014-05-16
    • 1970-01-01
    • 2011-12-06
    • 2018-05-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多