未提供“string”类型的必需属性“og:title”

问题描述 投票:2回答:1

当我在facebook linter中调试我的网页时,它会一直显示警告:

“未提供''属性'og:''类型'字符串'的标题”

我已经阅读了有关SO的建议,并尝试过:

  • 没有gzip压缩
  • 重新调整fb调试器
  • 仅使用Facebook og meta标签构建新的测试页面

但警告是一样的。

测试页面代码是:

<!DOCTYPE html>
<html  prefix="og: http://ogp.me/ns#" >
<head>
   <title>testing page</title>
     <meta property="og:title" content="testing page og title" />  
     <meta property="og:type" content="article" />
     <meta property="og:url" content="https://www.skinvac.com/test.html" />
     <meta property="og:image" content="https://www.skinvac.com/test-image.png" />
     <meta property="og:description" content="testing page og description " />

      <meta name= "keywords" content="test " />
      <meta name= "description" content="test" />
</head>
    <body>
      <h1>test</h1>     
      <img src="test-image.png">
    </body>
</html>

调试结果可以在这里看到facebook share debugger result

有一个警告:“'og:type'属性是必需的,但不存在。”

但是“og:title”属性位于标题标记中。

我该如何解决这个问题?

谢谢

facebook facebook-opengraph
1个回答
7
投票

您使用的是https,但没有有效的SSL证书。用代码中的http替换https,然后使用http链接进行测试。

© www.soinside.com 2019 - 2024. All rights reserved.