Skip to content

Commit 4c1c8d8

Browse files
committed
fix: correctly URL encode share links
Relates to #496
1 parent 2103191 commit 4c1c8d8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

_includes/post-sharing.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
<span class="share-label text-muted mr-1">{{ site.data.locales[lang].post.share }}</span>
77
<span class="share-icons">
88
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
9-
{% assign url = page.url | absolute_url %}
9+
{% assign title = title | url_encode %}
10+
{% assign url = page.url | absolute_url | url_encode %}
1011

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

0 commit comments

Comments
 (0)