提供og:image URL,[AWS S3的URL]无法处理为图像,因为其内容类型无效 [英] Provided og:image URL, [url to AWS S3] could not be processed as an image because it has an invalid content type

查看:145
本文介绍了提供og:image URL,[AWS S3的URL]无法处理为图像,因为其内容类型无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

建立我的公司网站,并希望当我在Facebook上共享链接时显示图片.每个页面都会显示正确的元描述和标题,但图像不会显示.Facebook调试器工具不断给我这个错误,每次我共享一个链接时都说它具有无效的内容类型.

Building my company website and want the image to display when I share the link on facebook. The correct meta description and titles show up for each page but not the images. The facebook debugger tool keeps giving me this error and everytime I share a link it says that it has an invalid content type.

我希望我的徽标在我每次在Facebook上共享链接时都显示出来,因此可以在我的base.html文件中进行扩展.

I want my logo to appear for everytime I share a link on facebook so I have it extended in my base.html file.

这在我的base.html页面中:

This is in my base.html page:

  <meta property="og:image:url" content="{% static 'img/ssg600.png' %}"/>
  <meta property="og:image:secure_url" content="{% static 'img/ssg600.png' %}"/>
  <meta property="og:image:type" content="image/png" />
  <meta property="og:image:width" content="600"/>
  <meta property="og:image:height" content="600"/>
  <meta property="og:type" content="website"/>

静态链接已附加到我的aws s3帐户,在我甚至开始使用这些元标记之前,图像就已经很好地显示在FB上了.现在它不起作用了,我不知道为什么.

The static link is attached to my aws s3 account and before I even started working with these meta tags, the image was displaying on FB just fine. Now its not working and I can't figure out why.

推荐答案

我发现了问题所在.我很笨,最后弄错了静态网址.应该是{%"static'static/img/ssg600.png'"%}

I figured out the issue. I was dumb and ended up mistyping the static url. It was supposed to be {%"static 'static/img/ssg600.png' "%}

我想对任何想知道为什么他们的图片不出现的人说:1.检查您的链接,2.确保您的amazon s3图像是公开的(可以通过单击显示在其上的链接来做到这一点.您的网站.如果它是公共网站,它将显示出来.否则,它会说访问被拒绝.)3.确保您的元URL与您呈现的页面匹配(另一个页面我似乎有正确的信息,但是我输入了错误的元数据)url,因此图像将无法正确呈现."

What I will say to anyone who is wondering why their pictures aren't appearing is to 1. Check your links, 2. Make sure your amazon s3 images are public (can do this by clicking on the link that is rendered on your site. If its public it will show up. Otherwise it will say access denied.) 3. Make sure your meta urls match the page that you rendered (Another page I had seemed to have the correct information but I had included the wrong meta url and so the image would not render properly."

这篇关于提供og:image URL,[AWS S3的URL]无法处理为图像,因为其内容类型无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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