Support rel atribute in social links (#735)

Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
Emruz Hossain 2023-02-09 23:03:59 +06:00 committed by GitHub
parent b498330793
commit 0d20efe1b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -5,3 +5,4 @@ go 1.19
require github.com/hugo-toha/hugo-toha.github.io v0.0.0-20221228191121-007f31838bd6 // indirect
replace github.com/hugo-toha/toha/v4 => ../../toha
// replace github.com/hugo-toha/hugo-toha.github.io => ../../hugo-toha.github.io

View file

@ -30,11 +30,11 @@
{{ range .socialLinks }}
<li>
{{ if eq .name "Email" }}
<a href="mailto:{{ .url }}" title="{{ .name }}" target="_blank" rel="noopener"><i class="{{ .icon }}"></i></a>
<a href="mailto:{{ .url }}" title="{{ .name }}" target="_blank" rel="{{.rel | default "noopener"}}"><i class="{{ .icon }}"></i></a>
{{ else if eq .name (i18n "phone") }}
<a href="tel:{{ .url }}" title="{{ .name }}" target="_blank" rel="noopener"><i class="{{ .icon }}"></i></a>
<a href="tel:{{ .url }}" title="{{ .name }}" target="_blank" rel="{{.rel | default "noopener"}}"><i class="{{ .icon }}"></i></a>
{{ else }}
<a href="{{ .url }}" title="{{ .name }}" target="_blank" rel="noopener"><i class="{{ .icon }}"></i></a>
<a href="{{ .url }}" title="{{ .name }}" target="_blank" rel="{{.rel | default "noopener"}}"><i class="{{ .icon }}"></i></a>
{{ end }}
</li>
{{ end }}