【问题标题】:Linkedin sharing not picking the og:imageLinkedin 分享不选择 og:image
【发布时间】:2021-02-12 01:12:00
【问题描述】:

我正在在linkedin 上实现帖子共享,并且我希望在帖子被共享时将网址 og:image 显示在linkedin 上。但即使我已将正确的 url 添加到 og:image 元标记。分享帖子后,它既没有出现在分享对话中,也没有出现在linkedin上。

这是我用来在linkedin上分享我的帖子的网址:

https://www.linkedin.com/shareArticle?mini=true&url=http://my_website.com:9000/post/40420&title=Test&summary=Description&source=MyWebsite

【问题讨论】:

  • 我遇到了同样的问题。似乎他们缓存了图片网址。将一个虚拟字符串附加到您的 url (https://www.example.com/your-image.jpg?abc),您就可以开始了。
  • 同样的问题,但我终于意识到他们只接受 .jpg.png 扩展格式。

标签: linkedin linkedin-api socialshare


【解决方案1】:

我昨晚也遇到了同样的问题。花了几个小时研究解决方案,但无济于事。最后我就这个问题联系了LinkedIn,他们立即回复了。他们的开发团队实施了一个名为“Post Inspector”的新工具,可让您优化内容共享。从字面上看,这在短短几分钟内就真正奏效了。

您所要做的就是输入您的网址,他们会完成所有繁忙的工作,即验证图像、作者、标题、描述、发布日期等属性的正确代码。他们不仅会验证,还会告诉您要包含哪些代码、缺少什么以及如何修复它。

这里是使用 Post Inspector 的网站:

https://www.linkedin.com/post-inspector/

【讨论】:

【解决方案2】:

LinkedIn 对共享有此要求(但请注意,LinkedIn 网页上的引号看起来不对 - ' 与 " 匹配)

以下是 og: 必须存在的标签及其正确格式:

  • <meta property='og:title' content='Title of the article"/>
  • <meta property='og:image' content='//media.example.com/ 1234567.jpg"/>
  • <meta property='og:description' content='Description that will show in the preview"/>
  • <meta property='og:url' content='//www.example.com/URL of the article" />

以下是 LinkedIn 共享模块的特定图片要求:

  • 最大文件大小:5 MB
  • 最小图像尺寸:1200(宽)x 627(高)像素
  • 推荐比例:1.91:1

您可以找到更多详细信息 这里:https://www.linkedin.com/help/linkedin/answer/46687/making-your-website-shareable-on-linkedin?lang=en

【讨论】:

    【解决方案3】:

    我花了 1 个小时才弄明白。

    把图片标签放在 <head>之后。

    <head>
    <meta
        name="image"
        property="og:image"
        content="https://2d-array-rotation.com/static/images/2d_array_rotation.jpg"
    >
    

    有时软件工程师会使事情复杂化。

    【讨论】:

      【解决方案4】:
      <meta property='og:title' content='Title of the article"/>
      <meta property='og:image' content='//media.example.com/ 1234567.jpg"/>
      <meta property='og:description' content='Description that will show in the preview"/>
      <meta property='og:url' content='//www.example.com/URL of the article" />
      

      【讨论】:

      • 注意:HTML 不使用,也不需要或要求在任何标签上加上斜线,并且在任何 HTML 规范中都没有。
      猜你喜欢
      • 1970-01-01
      • 2014-11-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-06
      • 1970-01-01
      • 2014-01-24
      • 2015-06-28
      相关资源
      最近更新 更多