Possible Duplicate:
How does Facebook Sharer select Images?
当用户在使用 http://www.facebook.com/sharer.php 的站点上使用共享按钮共享站点 url 时,想要共享缩略图实现这一目标。
网站没有 img 标签,所有图片都在 css 中定义。
我为图片添加了元标签:
<meta property="og:image" content="/images/branding/branding-logo.png"/>
和
<link rel="image_src" href="/images/branding/branding-logo.png"/>
但它不起作用:(
使用 Open Graph Meta Tags 的完整列表:
- og:title - 实体的标题。
- og:type - 实体的类型。您必须从开放图谱类型列表中选择一种类型。
- og:image - 表示实体的图像的 URL。图片必须至少为 50 x 50 像素。方形图片效果最好,但您最多可以使用宽度是高度的三倍的图片。
- og:url - 表示实体的页面的规范、永久 URL。当您使用 Open Graph 标签时,“赞”按钮会发布指向 og:url 的链接,而不是“赞”按钮代码中的 URL。
- og:site_name - 您网站的人类可读名称,例如“IMDb”。
- fb:admins 或 fb:app_id - 页面管理员的 Facebook ID 或 Facebook 平台应用程序 ID 的逗号分隔列表。至少,只包含您自己的 Facebook ID。
还使用绝对 URL 而不是相对 URL!
编辑:
请注意,Facebook 会在特定时期缓存网页,因此您可能不会立即注意到您的更改。检查 Facebook 是否/将实际接受您的更改的一个好方法是在您的 URL 中伪造一个参数。
例如,如果您的 URL 为:http://example.com/index.php
添加如下内容:http://example.com/index.php?123
然后在 URL Linter 中使用它. ;-)
编辑 2:
您可以直接使用 Facebook Linter(现在称为 Debugger),但请注意,在某些情况下,某些数据不能被更改,描述为here。 :
Editing Meta Tags
You can update the attributes of your page by updating your page's
tags. Note that og:title and og:type are only editable
initially - after your page receives 50 likes the title becomes fixed,
and after your page receives 10,000 likes the type becomes fixed.
These properties are fixed to avoid surprising users who have liked
the page already. Changing the title or type tags after these limits
are reached does nothing, your page retains the original title and
type.