Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL for Social sharing on post footer not working #2

Open
sarathlal-old opened this issue Dec 17, 2013 · 1 comment
Open

URL for Social sharing on post footer not working #2

sarathlal-old opened this issue Dec 17, 2013 · 1 comment

Comments

@sarathlal-old
Copy link

The social sharing on post footer have some URL issues.

If I use {{ post.url}} instead of your {{ page.url}}, it is not working. I want to manually add my home URL with {{ page.url}} in sharing code.

Like http://myhomepage{{ page.url}}

Now my code look like,

<a class="icon-twitter" href="http://twitter.com/share?text={{page.title}}&url=http://sarathlal.com{{ page.url }}" onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;"> <span class="hidden">Twitter</span> </a>

Even in Kasper demo, the links for social sharing are broken.

@nofair
Copy link

nofair commented Dec 27, 2013

To make it work, first specify the url parameter in _config.yml, as it needs to be hard coded there.
Then, swap {{page.url}} in the social links, since it clearly doesn't work, with:

{{ site.url }}{{ page.url }}

{{page.url}} spits out only the last part of the adress, i.e. example.com/2013/post, which is why it wasn't working properly. After you add the lacking piece of the puzzle, it's done.

I also recommend completely changing the Twitter part to something akin to:

<a class="icon-twitter" href="https://twitter.com/intent/tweet?text=&quot;{{ page.title }}&quot;%20{{ site.url }}{{ page.url }}%20via%20&#64;TWITTERHANDLE">

where TWITTERHANDLE - your nickname there. This way you lose the popup behaviour but gain "via" and it works flawlessly.

mattbostock pushed a commit to mattbostock/mattbostock.github.io that referenced this issue Sep 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants