LinkedIn共享链接图片未使用自定义url更新



当我单击时,正在共享内容。但是图像没有被更新。我正在一个单页网站应用程序中工作。

var customshareurlLnkd = 'https://www.linkedin.com/shareArticle?mini=true&url=' + encodeURI(globalConfig.main_site_root + '&title=' + data.content.title +'&source=CMS') ;
detailhtml += '&nbsp<a class="sharebtn" href="' + customshareurlLnkd + '" target="_blank">LinkedIn Share</a>';

我尝试过这个链接:http://beta.beantin.se/clearing-linkedin-link-sharing-preview-cache/,但仍滞留了数小时。有什么解决方案吗?提前感谢

要让LinkedIn在用户即将共享时在共享对话框中显示预览数据,您需要在HTML的<head>块中设置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" />

来源:领英开发者文档:让你的网站在领英上共享。

即使您使用的是ReactJS或NodeJS之类的东西,您仍然可以将index.html的<head>块设置为包含适当的og:标记。

您可以通过LinkedIn Post Inspector使用您的URL来确定您是否做得正确。

我还编写了自己的工作演示,它使用og:标签使LinkedIn共享正常工作。查看:www.sortwords.com。

最新更新