feat: Add email cloaking functionality and update social links in configuration
All checks were successful
Hugo Publish CI / build-and-deploy (push) Successful in 17s

This commit is contained in:
2025-12-20 19:56:51 -06:00
parent b19b045fc0
commit 9ec652c9c3
3 changed files with 77 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
{{ with .Site.Params.social }}
<ul>
{{ range sort . "weight" }}
{{ if .icon }}
<li>
{{ if .email }}
{{ $iconHTML := printf "<i class=\"%s\" aria-hidden=\"true\"></i>" .icon }}
{{ partial "cloakemail" (dict "address" .email "protocol" "mailto" "display" $iconHTML) }}
{{ else }}
<a href="{{ .url | safeURL }}" aria-label="{{ .name }}" {{ if .rel }}rel="{{ .rel }}" {{ end }} {{ if .target
}}target="{{ .target }}" {{ end }} {{ if .type }}type="{{ .type }}" {{ end }}>
<i class="{{ .icon }}" aria-hidden="true"></i>
</a>
{{ end }}
</li>
{{ else }}
<li>
{{ if .email }}
{{ partial "cloakemail" (dict "address" .email "protocol" "mailto" "display" .name) }}
{{ else }}
<a href="{{ .url | safeURL }}" aria-label="{{ .name }}" {{ if .rel }}rel="{{ .rel }}" {{ end }} {{ if .target
}}target="{{ .target }}" {{ end }}>{{ .name }}</a>
{{ end }}
</li>
{{ end }}
{{ end }}
</ul>
{{ end }}