2012-07-15 70 views
3

当我的Tumblr博客中的链接发布在Facebook上时,Facebook在标题标签之间抓取标题,而不是在开放图形元标签中指定的标题。它为什么这样做?有什么方法可以解决它吗?Facebook上的开放图形协议Tumblr

+0

你可以发布样本链接吗?已经尝试[调试器](https://developers.facebook.com/tools/debug)?它告诉你什么? – borisdiakur 2012-07-15 20:47:27

回答

16

在没有看到代码,我不知道你在做什么的问题正是,但对于其他人搜索这个寻找如何设置的Open Graph自己的博客上,尝试做这样的事情:

<!-- FACEBOOK OPEN GRAPH --> 
<!-- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>--> 

<meta property="og:site_name" content="{Title}"/> 

{block:PermalinkPage} 

    <meta property="og:url" content="{Permalink}"/> 
    <meta property="og:type" content="article"/> 

     {block:Posts} 
      {block:Text} 
       {block:Title}<meta property="og:title" content="{PlaintextTitle}"/>{/block:Title} 
       <meta property="og:description" content="{PlaintextBody}"/> 
      {/block:Text} 

      {block:Photo} 
       <meta property="og:image" content="{PhotoURL-500}"/> 
       {block:Caption}<meta property="og:description" content="{PlaintextCaption}"/>{/block:Caption} 
      {/block:Photo} 

      {block:Photoset} 
       {block:Photos} 
       <meta property="og:image" content="{PhotoURL-500}"/> 
       {/block:Photos} 
       {block:Caption}<meta property="og:description" content="{PlaintextCaption}"/>{/block:Caption} 
      {/block:Photoset} 

      {block:Quote} 
       <meta property="og:title" content="{PlaintextQuote}"/> 
       <meta property="og:description" content="{PlaintextSource}"/> 
       <meta property="og:image" content="{PortraitURL-64}"/> 
      {/block:Quote} 

      {block:Link} 
       <meta property="og:title" content="{PlaintextName}"/> 
       <meta property="og:description" content="{PlaintextDescription}"/> 
       <meta property="og:image" content="{PortraitURL-64}"/> 
      {/block:Link} 

      {block:Chat} 
       <meta property="og:title" content="{PlaintextTitle}"/> 
       <meta property="og:description" content="{block:Lines}{block:Label}{Label}: {/block:Label}{Line} &bull; {/block:Lines}"/> 
       <meta property="og:image" content="{PortraitURL-64}"/> 
      {/block:Chat} 

      {block:Audio} 
       <meta property="og:title" content="{block:Artist}{Artist} - {/block:Artist}{block:TrackName}{TrackName}{/block:TrackName}"/> 
       <meta property="og:description" content="{PlaintextCaption}"/> 
       {block:AlbumArt}<meta property="og:image" content="{AlbumArtURL}"/>{/block:AlbumArt} 
      {/block:Audio} 

      {block:Video} 
       {block:Caption}<meta property="og:description" content="{PlaintextCaption}"/>{/block:Caption} 
      {/block:Video} 

      {block:Answer} 
       <meta property="og:title" content="{PlaintextQuestion}"/> 
       <meta property="og:description" content="{PlaintextAnswer}"/> 
       <meta property="og:image" content="{PortraitURL-64}"/> 
      {/block:Answer} 

     {/block:Posts} 

{/block:PermalinkPage} 

{block:IndexPage} 
     <meta property="og:title" content="{Title}"/> 
     <meta property="og:type" content="blog"/> 
     <meta property="og:description" content="{MetaDescription}"/> 
     <meta property="og:image" content="{PortraitURL-64}"/> 
{/block:IndexPage} 

应该涵盖几乎任何你可以通过它!

请记住,所有代码都属于关闭</head>标记之前。

+1

为什么会有一个downvote提供大量有用的信息,可以帮助用户解决他们的问题? – graygilmore 2012-07-23 23:58:32

+0

我注意到Tumblr添加了他们自己的Facebook和Twitter元数据。这可能会派上用场,将上面的答案与Tumblr产生的内容混合在一起(这是从我的博客,用tumblr网站的数据交换值): https://gist.github.com/chuckbergeron/5106e3e72c8e7e8d54d2c189f472e5d3 – 2016-06-12 06:21:31

相关问题