Skip to content

Commit

Permalink
fix: correctly URL encode share links
Browse files Browse the repository at this point in the history
Relates to #496
  • Loading branch information
ZakKemble committed Mar 3, 2022
1 parent 2103191 commit 4c1c8d8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions _includes/post-sharing.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
<span class="share-label text-muted mr-1">{{ site.data.locales[lang].post.share }}</span>
<span class="share-icons">
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
{% assign url = page.url | absolute_url %}
{% assign title = title | url_encode %}
{% assign url = page.url | absolute_url | url_encode %}

{% for share in site.data.share.platforms %}
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url | escape %}
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
<a href="{{ link }}" data-toggle="tooltip" data-placement="top"
title="{{ share.type }}" target="_blank" rel="noopener" aria-label="{{ share.type }}">
<i class="fa-fw {{ share.icon }}"></i>
Expand Down

0 comments on commit 4c1c8d8

Please sign in to comment.