{{ if ne .Params.share false }}
{{ range where hugo.Data.page_sharer.links "enable" true }} {{/* mailto URIs require percent-encoding (%20 for spaces) per RFC 6068, not form-encoding (+ for spaces). */}} {{/* Use urls.PathEscape for mailto; urlquery for other schemes (https, etc.). */}} {{ $is_mailto := eq (urls.Parse .url).Scheme "mailto" }} {{ $link := replace .url "{url}" (cond $is_mailto (urls.PathEscape $.Permalink) (urlquery $.Permalink)) }} {{ $link = replace $link "{title}" (cond $is_mailto (urls.PathEscape $.Title) (urlquery $.Title)) }} {{ partial "functions/get_icon" (dict "name" .icon "attributes" "style=\"height: 1em;\"") }} {{ end }}
{{ end }}