Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ovilia/13d261366ad91aecc202 to your computer and use it in GitHub Desktop.
Save Ovilia/13d261366ad91aecc202 to your computer and use it in GitHub Desktop.
2014-08-03-make-your-own-social-sharing-bar-with-jekyll-03
{% assign tagStr = '' %}
{% capture url %}{{ site.url }}{{ page.url }}{% endcapture %}
{% if page.shortUrl != null %}
{% assign url = page.shortUrl %}
{% for tag in page.tags %}
{% capture tagStr %}{{ tagStr }},{{ tag }}{% endcapture %}
{% endfor %}
{% endif %}
<hr />
<h4>Share This Post</h4>
<div class="social-share">
<a class="social-share-element" id="social-twitter" href="https://twitter.com/intent/tweet?text={{ page.title }}&url={{ url }}&via=OviliaZhang&hashtags={{ tagStr }}" target="_blank" title="Share this post on Twitter"></a>
<a class="social-share-element" id="social-facebook" href="https://www.facebook.com/sharer/sharer.php?t={{ page.title }}&u={{ url }}" target="_blank" title="Share this post on Facebook"></a>
<a class="social-share-element" id="social-google" href="https://plus.google.com/share?url={{ site.url }}{{ page.url }}" target="_blank" title="Share this post on Google Plus"></a>
<a class="social-share-element" id="social-linkedin" href="http://www.linkedin.com/shareArticle?mini=true&title={{ page.title }}&url={{ url }}&source=http%3a%2f%2fzhangwenli.com" target="_blank" title="Share this post on LinkedIn"></a>
<a class="social-share-element" id="social-weibo" href="http://v.t.sina.com.cn/share/share.php?title=来看看+%40Ovilia允执厥中+的博文吧:{{ page.title }}&url={{ url }}" target="_blank" title="Share this post on Sina Weibo"></a>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment