فهرست منبع

Support rel atribute in social links (#735)

Signed-off-by: hossainemruz <hossainemruz@gmail.com>
Emruz Hossain 2 سال پیش
والد
کامیت
0d20efe1b7
2فایلهای تغییر یافته به همراه4 افزوده شده و 3 حذف شده
  1. 1 0
      exampleSite/go.mod
  2. 3 3
      layouts/partials/sections/about.html

+ 1 - 0
exampleSite/go.mod

@@ -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

+ 3 - 3
layouts/partials/sections/about.html

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