fix: correctly URL encode share links

Relates to #496
This commit is contained in:
Zak Kemble 2022-03-03 12:55:27 +00:00
parent 2103191b2f
commit 4c1c8d8b0e

View file

@ -6,10 +6,11 @@
<span class="share-label text-muted mr-1">{{ site.data.locales[lang].post.share }}</span> <span class="share-label text-muted mr-1">{{ site.data.locales[lang].post.share }}</span>
<span class="share-icons"> <span class="share-icons">
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %} {% 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 %} {% 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" <a href="{{ link }}" data-toggle="tooltip" data-placement="top"
title="{{ share.type }}" target="_blank" rel="noopener" aria-label="{{ share.type }}"> title="{{ share.type }}" target="_blank" rel="noopener" aria-label="{{ share.type }}">
<i class="fa-fw {{ share.icon }}"></i> <i class="fa-fw {{ share.icon }}"></i>