简体   繁体   English

博客文章的微数据使用

[英]Microdata usage for a blog post

I have a blog page and I am not sure if I understood the schema.org microdata correctly. 我有一个博客页面,不确定我是否正确理解了schema.org微数据。 I have a few cases in which I am unsure and I think it would be good to discuss them. 我有一些不确定的案例,我认为最好讨论一下。 My code: 我的代码:

<body lang="en" itemscope itemtype="http://schema.org/WebPage">
    <section class="blog" itemscope itemtype="http://schema.org/Blog">
        <article class="post" itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting">
            <header>
                <time class="publish-date" datetime="2011-11-06T13:42:04+01:00" itemprop="datePublished">
                    November 2011
                </time>
                <h1 itemprop="name"><a href=blog/post-slug.html" itemprop="url">
                    My Title Here
                </a></h1>
            </header>

            <section itemprop="description">
                <p>The lead text here</p>
            </section>

            <section itemprop="articleBody">
                <p>The other text here</p>
            </section>

            <footer>
                This article is published by
                <span itemprop="author">
                    John Doe
                </span>
                at 
                <time datetime="2012-10-01T15:33:04+02:00" itemprop="datePublished">
                    1 October 2012 on 15:33
                </time>
                and listed in the category 
                <a href=""><span itemprop="articleSection">
                    My Category
                </span></a>.
                The article is licensed under the <a href="http://creativecommons.org/licenses/by-sa/3.0/" target="_blank">Creative Commons Attribution-ShareAlike 3.0</a>.
            </footer>
        </article>

        <h1>Comments</h1>
        <ul class="comments" itemscope itemtype="http://schema.org/UserComments">
            <li itemprop="comment">
                <span itemprop="creator">Jane Doe</span>
                <time itemprop="commentTime" datetime="2011-05-08T19:30">May 8, 7:30pm</time>
                <article itemprop="commentText">
                    <p>A very good comment here</p>
                </article>
            </li>
        </ul>
    </section>
</body>
  1. Can I have multiple itemprop attributes? 我可以有多个itemprop属性吗? I am making the author copyright holder as well, but I am not sure if that is possible; 我也正在使作者成为版权所有者,但是我不确定是否可行。
  2. The list of comments is a user comments scope, the individual items are the itemprop of the comment, but I am not sure if that is possible; 评论列表是用户评论范围,单个项目是评论的itemprop,但是我不确定是否可行;
  3. I split the lead text and the body in my articles, so I can make a listing of blog posts easily. 我在文章中拆分了正文和正文,因此可以轻松列出博客文章。 I indicated the lead as a "description" and the body as the (complete?) article body, but I am not sure if articleBody is accounted for the complete text (including lead) or the text without the lead. 我将线索表示为“描述”,将正文表示为(完整?)文章正文,但是我不确定articleBody是占全文(包括线索)还是没有线索的文本。
  4. Are there any other mistakes I have made? 我还有其他错误吗?

Suggestions and corrections are greatly appreciated! 建议和更正,不胜感激!

Even generic HTML syntax forbids using the same attribute twice in an element. 甚至通用HTML语法也禁止在元素中使用相同的属性两次。 You can however nest elements and have the same attribute in nested elements. 但是,您可以嵌套元素,并且嵌套元素具有相同的属性。

The validator http://validator.w3.org also finds some other markup errors in your code. 验证器http://validator.w3.org还会在您的代码中发现一些其他标记错误。

There does not seem to be any evidence of schema.org markup being recognized by search engines except when found on large commercial or community sites. 似乎没有任何证据表明schema.org标记可以被搜索引擎识别,除非在大型商业或社区站点上可以找到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM