问题描述
当用户使用分享按钮在网站上共享使用来实现。
Want to have share thumbnail when user shares site url using share button on site which uses http://www.facebook.com/sharer.php to achieve that.
网站没有img标签,所有图片都在css中定义。
Site dose not have img tags, all images are defined in css.
我为图片添加了元标记:
I added meta tags for image:
<meta property="og:image" content="/images/branding/branding-logo.png"/>
和
<link rel="image_src" href="/images/branding/branding-logo.png"/>
但它不工作:(
推荐答案
使用的完整列表:
- og:title - 实体的标题
- og:type - 实体的类型,您必须从Open Graph类型列表
- og:image - 表示实体的图像的URL,图像必须至少为50像素乘50像素,方形图像效果最佳,但您是允许使用高达三倍的图像。
- og:url - 表示实体的页面的规范的永久URL当您使用Open Graph标签时,喜欢按钮发布一个指向og:url的链接,而不是Like按钮代码中的URL。
- og:site_name - 您网站的可读名称,例如IMDb。
- fb:admins或fb:app_id - 以逗号分隔的列表,未知行为者或Facebook平台应用程序ID。至少只包括你自己的Facebook ID。
- og:title - The title of the entity.
- og:type - The type of entity. You must select a type from the list of Open Graph types.
- og:image - The URL to an image that represents the entity. Images must be at least 50 pixels by 50 pixels. Square images work best, but you are allowed to use images up to three times as wide as they are tall.
- og:url - The canonical, permanent URL of the page representing the entity. When you use Open Graph tags, the Like button posts a link to the og:url instead of the URL in the Like button code.
- og:site_name - A human-readable name for your site, e.g., "IMDb".
- fb:admins or fb:app_id - A comma-separated list of either the Facebook IDs of page administrators or a Facebook Platform application ID. At a minimum, include only your own Facebook ID.
还使用绝对网址而不是亲戚!
Also use absolute URLs instead of relative!
编辑:
请注意,Facebook缓存特定时期的网页,以免您立即注意到您的更改。一个很好的方式来检查Facebook是否实际上会改变你的网址是通过伪造你的URL中的一个参数。
,例如,如果你的网址是: http://example.com /index.php
添加以下内容: http://example.com/index.php?123
然后请在中使用它。 ; -)
Please note that Facebook caches webpages for specific periods so you may not notice your changes right away. A good way to check if Facebook is/will actually take your changes is by faking a parameter in your URL.
for example if your URL reads: http://example.com/index.php
Add something like: http://example.com/index.php?123
and then use it in the URL Linter. ;-)
编辑2:
您可以直接使用Facebook Linter(现在称为),但请注意,有些数据 不能 在某些情况下被更改,描述:
EDIT 2:
You could directly use the Facebook Linter (now called Debugger), but be aware that some data cannot be changed in some cases, described here:
您可以通过更新页面的
标签来更新页面的属性。请注意,og:title和og:type最初只能编辑
- 在您的页面收到50个喜欢的标题变得固定后,
,并且在您的页面收到10,000个类型变为固定后。
这些属性是固定的,以避免令人惊讶的用户已经喜欢
的页面。达到这些限制
之后更改标题或类型标签不会执行任何操作,您的页面保留原始标题和
类型。
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.
这篇关于Facebook分享url缩略图问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!