og meta Facebook & rails index:共享信息未在 Facebook share-box 中更新,但在 HTML 中更正



我在我的一个rails索引视图中使用Facebook打开图元标记,这是一篇包含Facebook链接分享的文章。

第一篇文章一切都运行良好,Facebook 分享框考虑了提供的元(标题、网址等)。但是当我想分享另一个帖子时,Facebook共享框会保留以前的帖子信息。在html中,元很好,当我使用facebook调试时,一切都很好。

我错过了什么?有缓存刷新要做?非常感谢您的帮助

<meta property="og:title" content="<%= @post.title %> wanted on XXX!" />
<meta property="og:site_name" content= "Site Name" />
<meta property="og:url" content="http://siteroot<%= display_path(@post) %>" />
<meta property="og:description" content="Site is bla bla bla" />
<meta property="og:image" content="<%= @post.vignette.url(:medium) %>" />
<meta property="og:type" content="article" />
<meta property="article:publisher" content="https://www.facebook.com/appname" />
<meta property="article:section" content="Responsive" />

我不知道你是否在这样做,但要确保你分享的是帖子页面而不是索引页面。

href="www.facebook.com/sharer/sharer.php?u=<%= @post.url %>"

如果不重新加载页面,头部中的og标签将不会更新,因此您必须将Facebook指向每个帖子的唯一URL。

最新更新