Facebook 发布链接图片 [英] Facebook Post Link Image

查看:68
本文介绍了Facebook 发布链接图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当有人在 Facebook 上发布链接时,脚本通常会扫描该链接以查找任何图片,并在帖子旁边显示一个快速缩略图.对于某些 URL(包括我的),FB 似乎没有找到任何东西,尽管它们在该页面上有很多图像.

When someone posts a link on facebook, a script usually scans that link for any images, and displays a quick thumbnail next to the post. For certain URLs though (including mine), FB doesn't seem to pick up anything, despite their being a number of images on that page.

我读到 FB 更喜欢用户希望指定的图像的image_src"rel 标记,但这也不会为我的站点生成该缩略图.

I read up that FB prefers the "image_src" rel tag for the image the user wishes to specify, but this does not generate that thumbnail either for my site.

我的 url 直接进入 DNS,没有转发,所以我认为这也不是问题.

My url goes directly to the DNS, and is not forwarded, so I don't imagine that could be the problem either.

有谁知道为什么 FB 不能从我的网站生成任何缩略图?

Does anyone have an idea as to why FB can't generate any thumbnails from my site?

推荐答案

最简单的方法就是一个链接标签:

The easiest way is just a link tag:

<link rel="image_src" href="http://stackoverflow.com/images/logo.gif" />

但是,您还可以向您的网站添加一些其他内容,以使其对社交媒体更加友好:

But there are some other things you can add to your site to make it more Social media friendly:

开放图谱标签

开放图谱标签是您添加到网站 的标签,用于描述您的页面所代表的实体,无论是乐队、餐厅、博客还是其他东西.

Open Graph tags are tags that you add to the <head> of your website to describe the entity your page represents, whether it is a band, restaurant, blog, or something else.

开放图谱标签如下所示:

An Open Graph tag looks like this:

<meta property="og:tag name" content="tag value"/> 

如果您使用开放图谱标签,则需要以下六个标签:

If you use Open Graph tags, the following six are required:

  • og:title - 实体的标题.
  • og:type - 实体的类型.您必须从开放图谱类型列表中选择一种类型.
  • og:image - 表示实体的图像的 URL.图像必须至少为 50 x 50 像素.方形图片效果最好,但您最多可以使用宽度为高度三倍的图片.
  • og:url - 代表实体的页面的规范、永久 URL.当您使用开放图谱标签时,Like 按钮会发布一个指向 og:url 的链接,而不是 Like 按钮代码中的 URL.
  • og:site_name - 您网站的可读名称,例如IMDb".
  • fb:adminsfb:app_id - 页面管理员的 Facebook 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.

可以在 Open Graph 协议文档中找到有关 Open Graph 标签的更多信息以及有关管理页面的详细信息.

More information on Open Graph tags and details on Administering your page can be found on the Open Graph protocol documentation.

http://developers.facebook.com/docs/reference/plugins/like

这篇关于Facebook 发布链接图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆