Skip to content

A better share link for twitter #12

Merged
merged 3 commits into from

3 participants

@jk-gan

(*) modified the url for sharing to twitter

@ageitgey ageitgey commented on an outdated diff
_layouts/post.html
@@ -13,7 +13,7 @@ <h1 class="post-title">{{ page.title }}</h1>
</section>
<footer class="post-footer">
<section class="share">
- <a class="icon" href="http://twitter.com/share?text={{page.title | cgi_escape}}&amp;url={{site.url}}{{page.id}}" target="_blank">
+ <a class="icon" href="https://twitter.com/intent/tweet?url={{ site.url }}{{ page.id }}&text={{ page.title }}&via={{ site.twitter_username }}" target="_blank">
@ageitgey
Owner

Can you add the | cgi_escape filter to page.title here to make sure page title doesn't contain any invalid characters when the url is generated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@ageitgey
Owner

Thanks!

@ageitgey ageitgey merged commit 176a7a6 into ageitgey:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.