feat: support tooltip and PDF in new tab in about.avatar widget

This commit is contained in:
Geo committed 2022-04-21 13:34:17 +01:00
1 parent 1ed86e35ab
commit 719dcbe8f8
1 file changed
+5 -2
@@ -22,7 +22,8 @@
{{ if $avatar }}
<div class="avatar-wrapper">
{{ $avatar_image := $avatar.Fill "150x150 Center" }}
<img class="avatar {{if eq $avatar_shape "square"}}avatar-square{{else}}avatar-circle{{end}}" src="{{ $avatar_image.RelPermalink }}" alt="{{$person_page.Title}}">
<img class="avatar {{if eq $avatar_shape "square"}}avatar-square{{else}}avatar-circle{{end}}" src="{{ $avatar_image.RelPermalink }}" alt="{{$person_page.Title}}"
width="{{ $avatar_image.Width }}" height="{{ $avatar_image.Height }}">
{{with $person.status.icon}}<span class="avatar-emoji">{{.|emojify}}</span>{{end}}
</div>
{{ end }}
@@ -63,11 +64,13 @@
{{ $target := "" }}
{{ if not $scheme }}
{{ $link = .link | relLangURL }}
{{ if eq (path.Ext $link) ".pdf" }}{{ $target = "target=\"_blank\" rel=\"noopener\"" }}{{ end }}
{{ else if in (slice "http" "https") $scheme }}
{{ $target = "target=\"_blank\" rel=\"noopener\"" }}
{{ end }}
<li>
<a href="{{ $link | safeURL }}" {{ $target | safeHTMLAttr }} aria-label="{{ .icon }}">
<a href="{{ $link | safeURL }}" {{ $target | safeHTMLAttr }} aria-label="{{ .icon }}"
{{ with .label }} data-toggle="tooltip" data-placement="top" title="{{.}}"{{ end }}>
<i class="{{ $pack }} {{ $pack_prefix }}-{{ .icon }} big-icon"></i>
</a>
</li>