Files
hugo-profile/layouts/partials/sections/hero/social.html
T
Marek Pikuła 0a95ffa08a Don't open hero social link if href is local
In case link for a social icon in the hero image is set to local link
(e.g., "#contact"), don't open it in a new tab. It's useful if you don't
want to publish a link to your e-mail in clear text, and rather redirect
user to the contact form.

Signed-off-by: Marek Pikuła <marek@serenitycode.dev>
2024-06-02 00:49:36 +02:00

24 lines
656 B
HTML

<span>
{{ range .Site.Params.hero.socialLinks.fontAwesomeIcons }}
<span class="px-1">
<a href="{{ .url }}"
{{ if not (hasPrefix .url "#") }} target="_blank" {{ end }}
class="btn social-icon"
>
<i class="{{ .icon }}"></i>
</a>
</span>
{{ end }}
{{ range .Site.Params.hero.socialLinks.customIcons }}
<span class="px-1">
<a href="{{ .url }}"
{{ if not (hasPrefix .url "#") }} target="_blank" {{ end }}
class="btn social-icon"
>
<img src="{{ .icon }}">
</a>
</span>
{{ end }}
</span>