【问题标题】:What is the proper RDFa syntax for an Organization logo?组织徽标的正确 RDFa 语法是什么?
【发布时间】:2020-05-01 12:22:10
【问题描述】:

我正在尝试使用 Google 的 Structured Data Testing Tool 让我的文章页面具有有效的 RDFa。我无法让它接受组织徽标。它一直抱怨“需要 url 字段的值”。我尝试将徽标 url 添加为“url”、“src”和“content”,如下所示。我还尝试在其中放置一个带有 property="logo" 的实际 <img> 标签,但我无法摆脱错误消息。有人解决了吗?

<div vocab="http://schema.org/" typeof="Article">
    <h1 property="headline name">My Amazing Article Title</h1>
    <meta property="articleSection" content="Sports" />
    <meta property="image" content="https://www.example.com/image.jpg" />
    <meta property="datePublished dateModified" content="2020-01-13" />

    <span property="author publisher" typeof="Organization">
        <meta property="name" content="MyCompanyName" />
        <meta property="logo" src="https://www.example.com/logo.png" url="https://www.example.com/logo.png" content="https://www.example.com/logo.png" />
        <meta property="url" content="https://www.example.com/" />
    </span>

    <div property="articleBody">
        Bla bla bla
    </div>
</div>

要查看确切的错误,您可以将上面的 sn-p 复制并粘贴到 Google 的工具中以查看我看到的内容。顺便说一句,如果我完全省略了徽标,Google 会抱怨需要徽标。

【问题讨论】:

    标签: html rdfa


    【解决方案1】:

    答案:

    <div vocab="http://schema.org/" typeof="Article">
        <h1 property="headline name">My Amazing Article Title</h1>
        <meta property="articleSection" content="Sports" />
        <meta property="image" content="https://www.example.com/image.jpg" />
        <meta property="datePublished dateModified" content="2020-01-13" />
    
        <span property="author publisher" typeof="Organization">
            <meta property="name" content="MyCompanyName" />
            <span property="logo" typeof="ImageObject">
                <meta property="url" content="https://www.example.com/logo.png" />
            </span>
            <meta property="url" content="https://www.example.com/" />
        </span>
    
        <div property="articleBody">
            Bla bla bla
        </div>
    </div>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-01-20
      • 2011-06-11
      • 1970-01-01
      • 2023-01-13
      • 1970-01-01
      • 2011-06-23
      • 2014-04-19
      相关资源
      最近更新 更多