使用 Facebook 的 Open Graph 协议,是否允许使用多个缩略图?
可能的重复:
Facebook Sharer 如何选择图像?
根据 Facebook 的 Open Graph 协议文档,您可以包含多个 og:image
元属性来关联多个图像与您的页面:
og:image
- 一个图像 URL,应该 代表你的对象 图形。图片必须至少为 50 像素 50px 并具有最大纵横比 比例为3:1。我们支持 PNG、JPEG 和 GIF 格式。您可以包含多个og:image
标签关联多个 您的页面上的图像。
但是,当我在 URL Linter 中加载页面时,我收到警告:
重复标签:您多次使用“image”,但它应该只出现一次
那么它是哪一个?
有没有更好的方法将多个缩略图与一个页面关联起来?
Possible Duplicate:
How does Facebook Sharer select Images?
According to Facebook's Open Graph protocol documentation, you may include multiple og:image
meta properties to associate multiple images with your page:
og:image
- An image URL which should
represent your object within the
graph. The image must be at least 50px
by 50px and have a maximum aspect
ratio of 3:1. We support PNG, JPEG and
GIF formats. You may include multipleog:image
tags to associate multiple
images with your page.
However, when I load my page in the URL Linter, I get a warning:
Duplicate tags: You used "image" multiple times, but it should only appear once
So which is it?
Is there a better way to associate multiple thumbnail images with a page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以添加多个 og:image 元标记。 Facebook 有左/右箭头控件,允许用户在图像之间进行选择。
如果 URL Linter 看到多个 og:image 标签,它应该在“调试”下显示为具有多个值的数据源:
You can add multiple og:image meta tags. facebook has left/right arrow controls that allow the user to choose between the images.
If URL Linter sees more than one og:image tag, it should show under the Debug as a Data Source with multiple values:
作为 og:image 元标记的替代方案,您可以将缩略图添加到 DOM 的末尾并将其可见性设置为隐藏。即使缩略图在页面本身上不可见,Facebook 也会识别它们。我通常这样做作为额外的预防措施,只是因为我过去经历过元标签的一些不稳定行为。
As an alternative to the og:image meta tag, you can add your thumbnail images to the end of the DOM and set their visibility to hidden. The thumbnails will be recognized by Facebook even though they are not visible on the page itself. I usually do this as an added precaution just because I have experienced some flaky behavior with the meta tags in the past.