我应该在博客中使用哪些微数据? [英] What microdata should I use for a blog?

查看:219
本文介绍了我应该在博客中使用哪些微数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

博客基本上是一个页面,其中列出了10篇文章的摘要,每篇文章的标题链接到整篇文章页面。



我见过: p>



我在哪里使用这些?



现在在个别文章页面上我有:

 < article itemscope itemtype =http://schema.org/Article> 

< h1 itemprop =name> < a href =...>标题...< / a> < / H1>

< div itemprop =articleBody>
bla bla
< / div>

...

< / article>

不错,我想,但是我在文章索引页上做了什么?我是否将这些添加到每篇文章中并向所有文章的容器元素添加 itemscope itemtype =http://schema.org/Blogitemprop =blogPosts?因为在文档中它并不表示该文章是博客的孩子...

解决方案

我同意别人的看法该主题非常模糊。我绝不会少尝试在这个问题上表达自己的想法,并告诉你我是如何在自己的博客上做的。



我同时使用 WebPage 博客项目类型同样的文件来标记不同的东西。



网页



我使用 WebPage 项目类型。通过这样做,我可以标记我的面包屑。

 < body itemscope itemtype =http ://schema.org/WebPage> 
    < li>
    < a href =foo> foo< / a>
    < / li>

    < li>
    < a href =foo / bar> bar< / a>
    < / li>

    < li>
    < a href =foo / bar / baz> baz< / a>
    < / li>
    < / ul>

    ...

    < / body>



博客帖子



当我循环博客文章我在包含所有博客文章的包装器上使用博客项目类型。我用属性 blogPostes 标记每篇文章,并且当然使用 BlogPosting 作为项目类型。

 < section itemscope itemtype =http://schema.org/Blog> 
< article itemprop =blogPostsitemscope itemtype =http://schema.org/BlogPosting>
...
< / article>

< article itemprop =blogPostsitemscope itemtype =http://schema.org/BlogPosting>
...
< / article>

...

< / section>



文章页面



在文章登陆页面上,我并不是使用博客项目类型。但我确实将帖子标记为 BlogPosting 项目。

 < article itemscope itemtype =http://schema.org/BlogPosting> 
...
< / article>






我能看到的唯一原因你会想用 Blog 项目类型标记某些内容,这是因为 blogPostes 属性和事实说它是一个博客。我认为你完全可以通过将该文章标记为 BlogPosting 来表明它是一个博客。
我也不认为在这种情况下使用属性是正确的,因为这是以复数形式使用的。对我来说,这反映了不同的使用领域。





编辑



我不确定模式是否已扩展,或者如果我第一次错过了模式,但博客项目现在有一个名为 blogPost 的属性,即单数形式 blogPosts 。那么我想说,将主元素标记为 Blog 项目并使用<$文章的c $ c> blogPost 属性,并将其标记为 BlogPosting 项目


The blog is basically a page that lists the summary of like 10 articles, each item title linking to the full article page.

I've seen:

Where do I use these?

Right now on the individual article page I have:

  <article itemscope itemtype="http://schema.org/Article">       

    <h1 itemprop="name"> <a href="..."> A title...  </a> </h1>    

    <div itemprop="articleBody">
       bla bla
    </div>

    ...

  </article>

Which is ok I guess, but what do I do on the article index page? Do I add these to each article and add itemscope itemtype="http://schema.org/Blog" itemprop="blogPosts" to the container element of all articles? Because in the docs it doesn't appear that article is a child of blog...

解决方案

I agree with what others say that the subject is very vague. Never the less I will attempt to express my thoughts on the matter and show you how I'm doing it on my blog.

I use both WebPage and Blog item types in the same document to mark up different things.

Web page

I use WebPage item type on the body tag. By doing so I can mark up my bread crumbs.

<body itemscope itemtype="http://schema.org/WebPage">
  <ul itemprop="breadcrumb">
    <li>
      <a href="foo">foo</a> 
    </li>

    <li>
      <a href="foo/bar">bar</a>
    </li>

    <li>
      <a href="foo/bar/baz">baz</a>
    </li>
  </ul>

    ...

</body>

Blog postes

When I loop the blog posts I use the Blog item type on the wrapper that contains all of the blog articles. I mark every article with the property blogPostes and uses of course BlogPosting as item type.

<section itemscope itemtype="http://schema.org/Blog">
  <article itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting">
    ...
  </article>

  <article itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting">
    ...
  </article>

  ...

</section>

Article page

See edit below for an update to this opinion

On the articles landing page I don't use the Blog item type. But I do mark the post as a BlogPosting item.

<article itemscope itemtype="http://schema.org/BlogPosting">
  ...
</article>


The only reason I can see that you would wanna mark something with a Blog item type is because of the blogPostes properties and the fact to say that it is a blog. I think you fulfill saying that it's a blog by marking the article as a BlogPosting. I also don't think it's correct using the property in this context since this is used in a plural form. To me that reflect a different area of use.


Edit

I'm not sure if the schema has extended or if I missed it the first time around, but the Blog item has a property called blogPost now, that is the singular form blogPosts. So then I would say that it makes more sense to mark up the main element as the Blog item and use the blogPost property for the article and mark it up as a BlogPosting item

这篇关于我应该在博客中使用哪些微数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆