为什么我在整合Facebook Open Graph时会收到错误“必需属性缺失”?

时间:2011-07-04 12:30:09

标签: html facebook rdf opengraph

我正在尝试将Facebook开放图表集成到我的网站中,但我通过URL Linter(https://developers.facebook.com/tools/lint)运行它,我收到错误:“必需属性丢失,og:标题是必需的“

我担心这是因为我的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

1 个答案:

答案 0 :(得分:1)

您正在将主页定义为与og: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/.