0

我有博客(http://loveclubhouse.blogspot.com/)。

(1) 我在博客顶部添加了一个点赞按钮。这是整个博客的全局点赞按钮。它可以从我博客的每一页获得,这样用户就可以表达他们对博客的总体态度(不管他们现在阅读的是博客的哪篇文章)。

<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Floveclubhouse.blogspot.com%2F&amp;action=like&amp;...></iframe>

我使用 facebook 的 Open Graph。因此,当用户点击这个赞按钮时,故事会在他的 Facebook 墙上创建,其标题、描述和预览图像之前在我的博客的 Open Graph 的 Meta 标签中定义。

<meta content='DJ Club Mixes 2012' property='og:title'/>
<meta content='blog' property='og:type'/>
<meta content='http://loveclubhouse.blogspot.com/' property='og:url'/>
<meta content='Blog's cover image URL' property='og:image'/>
<meta content='Blog's description' property='og:description'/>

(2) 除了全局点赞按钮之外,我还为我博客的每篇文章添加了标准的“addthis”分享按钮(假设用户想在他的墙上分享我博客中的某篇文章)。

<div class='addthis_toolbox addthis_default_style' expr:addthis:title='data:post.title' expr:addthis:url='data:post.url'>
   <a class='addthis_button_facebook'/>
   ...
</div>
<script type='text/javascript'>
   var addthis_config = {ui_click:true, data_track_clickback:true};
</script>
<script src='http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4d68d12853670207' type='text/javascript'/>

然而,当用户点击分享按钮进行发布时,facebook 会在他的墙上生成故事,其预览图像和标题与为整个博客设置的相同。

问题是:

如何结合(1)(2),使用户可能喜欢我的博客,并且用户可以在他的墙上分享特定的帖子以及该特定帖子的标题和预览图像?

4

1 回答 1

0

It's all about the OG tags on your page. When a user visits a different page in your blog, you need to be sure that the og:title and og:description (and og:image if you want) are updated to reflect the current article of your blog.

于 2012-04-02T01:20:55.587 回答