【问题标题】:Provided og:image URL, [url to AWS S3] could not be processed as an image because it has an invalid content type提供 og:image URL,[url to AWS S3] 无法作为图像处理,因为它具有无效的内容类型
【发布时间】:2019-12-30 22:18:30
【问题描述】:

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

我希望每次在 facebook 上分享链接时都会出现我的徽标,因此我将其扩展至我的 base.html 文件中。

这是在我的 base.html 页面中:

  <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 上显示得很好。现在它不起作用,我不知道为什么。

【问题讨论】:

  • 看HTML源代码的url是什么?

标签: html django image facebook-opengraph


【解决方案1】:

我发现了这个问题。我很笨,最后输错了静态网址。它应该是 {%"static 'static/img/ssg600.png' "%}

对于那些想知道为什么他们的图片没有出现的人,我要说的是 1. 检查您的链接,2. 确保您的 amazon s3 图片是公开的(可以通过单击呈现在你的网站。如果它是公开的,它会显示出来。否则它会说访问被拒绝。) 3. 确保你的元 URL 与你呈现的页面匹配(另一个页面我似乎有正确的信息,但我包含了错误的元url,因此图像无法正确呈现。”

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-09-01
    • 2020-06-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-08
    • 2020-06-06
    相关资源
    最近更新 更多