0

我有一个博客页面,但我不确定我是否正确理解了 schema.org 微数据。我有一些我不确定的案例,我认为讨论它们会很好。我的代码:

<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. 我可以有多个 itemprop 属性吗?我也在制作作者版权所有者,但我不确定这是否可能;
  2. 评论列表是用户评论范围,单个项目是评论的 itemprop,但我不确定这是否可能;
  3. 我将文章中的前导文本和正文分开,这样我就可以轻松地列出博客文章。我将前导表示为“描述”,将正文表示为(完整?)文章正文,但我不确定 articleBody 是指完整的文本(包括前导)还是没有前导的文本。
  4. 我还犯过其他错误吗?

非常感谢建议和更正!

4

1 回答 1

0

即使是通用的 HTML 语法也禁止在一个元素中使用相同的属性两次。但是,您可以嵌套元素并在嵌套元素中具有相同的属性。

验证器http://validator.w3.org还会在您的代码中发现一些其他标记错误。

似乎没有任何证据表明 schema.org 标记被搜索引擎识别,除非在大型商业或社区网站上找到。

于 2012-10-12T23:13:58.360 回答