imathis / octopress

Octopress is an obsessively designed framework for Jekyll blogging. It’s easy to configure and easy to deploy. Sweet huh?
http://github.com/imathis/octopress
9.31k stars 2.62k forks source link

Facebook and Google Plus Share and Counter is not referencing my url #1619

Open spasticninja opened 10 years ago

spasticninja commented 10 years ago

I was having an issue where the facebook and google+ share buttons weren't properly sharing my website. As a result the counters were wrong. Found a fix, however. I added:

data-href="{{ site.url }}{{ page.url }}"

to the <div class="g-plusone" ... > and <div class="fb-like" ...> in source/post/sharing.html

detournemint commented 9 years ago

It seems like this is a non issue now that you solved it, or do you want more help with it?

therealmarv commented 9 years ago

This is all a Octopress 2 problem. I also fixed it with help of this bug entry. Actually this is the best way to deal with Octopress 2: Just fix the small bugs yourself. An upgrade to Octopress 3 seems out of scope (never managed to get it working).

If somebody interested, the snippet I use on https://therealmarv.com On Twitter data-url and data-counturl is the key nowadays. Maybe my G+ and FB are also broken:

<div class="sharing">
  {% if site.twitter_tweet_button %}
  <a href="//twitter.com/share" class="twitter-share-button" data-url="{{ site.url }}{{ page.url }}" data-via="{{ site.twitter_user }}" data-counturl="{{ site.url }}{{ page.url }}" >Tweet</a>
  {% endif %}
  {% if site.google_plus_one %}
  <div class="g-plusone" data-size="{{ site.google_plus_one_size }}"></div>
  {% endif %}
  {% if site.facebook_like %}
    <div class="fb-like" data-send="true" data-width="450" data-show-faces="false"></div>
  {% endif %}
</div>