1

我有一个网站,我希望有一个类似 facebook 的按钮,该按钮经过自定义,因此它显示特定的图片、描述等。

所有这一切都完成了,它可以工作了,但是我使用了常规的 img、description、title 元标记,而不是我们应该使用的 og 标记。

当我使用http://developers.facebook.com/tools/debug对网站进行 lint 时,Facebook 会抱怨。

以下是一些错误消息:

Inferred Property:  The 'og:url' property 
should be explicitly provided, even if a value can be inferred from other tags.

Inferred Property:  The 'og:title' property
should be explicitly provided, even if a value can be inferred from other tags.

等等所有其他标签...

这就是问题所在:当我按照网络上提供的示例中所示添加和配置标签时,它不仅不起作用,而且还收到另一个错误:

Meta Tags In Body:  You have tags ouside of your . This is either because
your was malformed and they fell lower in the parse tree, or you accidentally 
put your Open Graph tags in the wrong place. Either way you need to fix it 
before the tags are usable.

这是我的html配置:

<html lang="en"  xmlns:fb="http://www.facebook.com/2008/fbml"
xmlns:og="http://opengraphprotocol.org/schema/">

...

<meta property="og:url" content="..." />
<meta property="og:site_name" content="..." />
<meta property="og:type" content="..." />
<meta property="og:title" content="..." />
<meta property="og:image" content="..." />
<meta property="og:description" content="..." />
<meta property="fb:app_id" content="..." />

...

注意:我的 fb-root 标记和其他 fb 提供的按钮代码与其他脚本一起位于页面的最底部。

注意:我在 Facebook 开发人员的开放图形网站或我的应用程序的 Facebook 开放图形部分进行了零配置,但是我认为这不是问题,因为在 fb 的说明中,他们说添加一个仅复制的点赞按钮需要/粘贴代码,并且不需要实际的打开图形配置。

这是站点 URL:http ://darehut.com 注意:我的标记代码实际上是在我的源代码的 head 元素内,但无论出于何种原因,它们都被呈现在外面!

谢谢你的帮助!!

4

1 回答 1

0

正文中的元标记:您的 . 这可能是因为您的格式错误并且它们在解析树中的位置较低,或者您不小心将 Open Graph 标记放在了错误的位置。

该消息缺少<head>第一个句点之前的单词。

这意味着什么,非常简单:要么将 OG 元标记放在<head>元素之外,要么 HTML 格式错误。


下次您提出此类问题时,请附上您遇到问题的文档的 URL——这样,我们可以自己查看,我们将能够更具体地回答。

于 2012-11-05T10:56:58.820 回答