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
All checks were successful
Hugo Publish CI / build-and-deploy (push) Successful in 17s
This commit is contained in:
28
layouts/partials/home/social.html
Normal file
28
layouts/partials/home/social.html
Normal 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 }}
|
||||
Reference in New Issue
Block a user