为什么我在集成 Facebook Open Graph 时收到错误"Required Property Missing"?



我试图将Facebook开放图集成到我的网站中,但我通过URL Linter运行了它(https://developers.facebook.com/tools/lint)我得到错误:"必需属性丢失,og:title是必需的">

我担心这是因为我的html无效或缺少一些东西:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Grahame Thomson</title>
<meta property="og:title" content="Grahame" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.grahamethomson.com" />
<meta property="og:image" content="http://grahamethomson.com/images/me.jpg" />
<meta property="og:site_name" content="grahamethomson_test.com" />
<meta property="og:description" content="Student and web designer living in Scotland."/>
</head>
<body>
</body>
</html>

站点链接:

http://grahamethomson.com/test/open_graph.html

您将主页定义为与og:url一起使用的url,而您应该使用当前url或完全忽略它。

og:url - The canonical URL of your object that will be used as its permanent ID in the graph, e.g., http://www.imdb.com/title/tt0117500/.

相关内容