打开图形调试工具错误推断属性

时间:2012-03-15 01:43:52

标签: facebook blogger open-graph-protocol

过去几天我一直在努力在我的博客上安装一个Facebook评论框,我已经设置了开放图形标签,以便我的博客可以作为Facebook页面被喜欢。从我在页面上看到的,所有似乎都正常运行,但是当我通过调试器运行我的博客地址时,我得到以下错误。

以下是我网站的链接:www.mommysnark.com

以下是调试工具给我的错误:

应该修复的类似按钮警告: og:标题丢失了。 og:title元标记是Facebook呈现新闻Feed故事的必要条件,该故事会产生较高的点击率。

最后,应该修复的开放图表警告:

推断属性:应明确提供'og:url'属性,即使可以从其他标记推断出值。

推断属性:应明确提供'og:title'属性,即使可以从其他标记推断出值。

推断属性:应明确提供“og:description”属性,即使可以从其他标记推断出值。

似乎一切正常,所以这些错误是否会被忽略?

1 个答案:

答案 0 :(得分:0)

您需要更正所有错误以获得最佳效果。属性og:titleog:url对您的目的尤其重要。以下是我在formlesspoet.blogspot.com博客上的Open Graph内容。您可以将其用作参考:

<!-- BEGIN FACEBOOK OPEN GRAPH -->
<b:if cond='data:blog.pageType == &quot;archive&quot;'>
    <meta expr:content='&quot;Posts from &quot; + data:blog.pageName + &quot; at Form and Formlessness&quot;' property='og:title'/>
</b:if>
<b:if cond='data:blog.pageType == &quot;index&quot;'>
 <b:if cond='data:blog.searchQuery'>
    <meta expr:content='&quot;Search results for “&quot; + data:blog.searchQuery + &quot;”&quot; + &quot; at Form and Formlessness&quot;' property='og:title'/>
 </b:if>
 <b:if cond='data:blog.searchLabel'>
    <meta expr:content='&quot;Posts tagged under “&quot; + data:blog.searchLabel + &quot;”&quot; + &quot; at Form and Formlessness&quot;' property='og:title'/>
 </b:if>
 <b:if cond='data:blog.searchQuery == &quot;&quot;'>
  <b:if cond='data:blog.searchLabel == &quot;&quot;'>
    <meta expr:content='&quot;Form and Formlessness&quot;' property='og:title'/>
  </b:if>
 </b:if>
</b:if>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
    <meta expr:content='&quot;“&quot; + data:blog.pageName + &quot;”&quot; + &quot; at Form and Formlessness&quot;' property='og:title'/>
</b:if>
<b:if cond='data:blog.pageType == &quot;static_page&quot;'>
    <!--Static Page-->
</b:if>

<meta content='article' property='og:type'/>
<meta content='This blog follows an exploration of poetry by Zahhar, going as far back as 1995. Posts include his poetry and articles about poetry, prosody, and poetics.' property='og:description'/>

<meta expr:content='data:blog.url' property='og:url'/>   
<meta content='http://sphotos.xx.fbcdn.net/hphotos-ash3/538645_3357819035748_1577184006_2624573_712999292_n.jpg' property='og:image'/>
<meta content='1577184006' property='fb:admins'/>
<meta expr:content='data:blog.title' property='og:site_name'/>   
<!-- END FACEBOOK OPEN GRAPH -->

请注意,og:title属性的设置会有所不同,具体取决于您正在查看的页面类型。我正试图找到一种方法来进一步完善这一点,但我还在等待答案。可以在底部附近找到og:descriptionog:url属性。请注意,我正在使用一些特定于Blogger的内容来获取og:titleog:url属性的当前页面的标题和网址。你也想做同样的事情。目前og:description属性是静态的,但我计划最终找到一种方法使其更加通用。仍在努力学习如何。用于og:image属性的URL实际上链接到我的一张Facebook相册中的照片。