mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 18:15:31 +00:00
fix: encoding of quotes in Page Sharer URL
Resolves merge conflicts in #2726 Fix #2726
This commit is contained in:
1 parent
9eb2f1fc3f
commit
22e2a7cf74
1 file changed
+8
-2
@@ -7,8 +7,14 @@
|
||||
{{ if in (slice "fab" "fas" "far" "fal") $pack }}
|
||||
{{ $pack_prefix = "fa" }}
|
||||
{{ end }}
|
||||
{{ $link := replace .url "{url}" ($.Permalink | htmlEscape) }}
|
||||
{{ $link = replace $link "{title}" ($.Title | htmlEscape) }}
|
||||
{{/* Utilise `urlquery` over `htmlEscape` to encode sharing URL */}}
|
||||
{{/* See https://github.com/wowchemy/wowchemy-hugo-themes/pull/2726 */}}
|
||||
{{ $link := replace .url "{url}" ($.Permalink | urlquery) }}
|
||||
{{ $link = replace $link "{title}" ($.Title | urlquery) }}
|
||||
{{/* Workaround `urlquery` encoding for mailto as `urlquery` encodes `+` as `%2B` and ` ` (space) as `+` */}}
|
||||
{{ if eq (urls.Parse $link).Scheme "mailto" }}
|
||||
{{ $link = replace $link "+" "%20" }}
|
||||
{{ end }}
|
||||
<li>
|
||||
<a href="{{$link|safeURL}}" target="_blank" rel="noopener" class="share-btn-{{.id}}" aria-label="{{.icon}}">
|
||||
<i class="{{$pack}} {{$pack_prefix}}-{{.icon}}"></i>
|
||||
|
||||
Reference in new issue
Block a user