Files
ericxliu-me/layouts/partials/home/social.html
Eric Liu 9ec652c9c3
All checks were successful
Hugo Publish CI / build-and-deploy (push) Successful in 17s
feat: Add email cloaking functionality and update social links in configuration
2025-12-20 19:56:51 -06:00

28 lines
1.0 KiB
HTML

{{ 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 }}