hugo-theme-zzo/layouts/partials/sidebar/site-bio.html

74 lines
2.8 KiB
HTML
Raw Normal View History

{{ if $.Param "enableBio" }}
<div class="bio">
2019-11-20 06:55:05 +00:00
<hr class="hr-slash bio-hr"/>
<div class="bio__photo-wrapper">
{{ $src := "" }}
{{ if site.Params.useGravatar }}
{{ $src = printf "https://s.gravatar.com/avatar/%s?s=200" (md5 .Site.Params.email) }}
<img src="{{ $src }}" alt="{{ if .Site.Params.myname }}{{ .Site.Params.myname }}{{ else }}Avatar{{ end }}" class="bio__photo"/>
{{ else }}
{{ if (fileExists "static/images/whoami/avatar.png") }}
<img data-src="{{ "images/whoami/avatar.png" | relURL }}" alt="{{ if .Site.Params.myname }}{{ .Site.Params.myname }}{{ else }}Avatar{{ end }}" class="lazyload bio__photo"/>
{{ else if (fileExists "static/images/whoami/avatar.jpg") }}
<img data-src="{{ "images/whoami/avatar.jpg" | relURL }}" alt="{{ if .Site.Params.myname }}{{ .Site.Params.myname }}{{ else }}Avatar{{ end }}" class="lazyload bio__photo"/>
{{ else }}
<img data-src="{{ "images/whoami/avatar.jpg" | relURL }}" alt="{{ if .Site.Params.myname }}{{ .Site.Params.myname }}{{ else }}Avatar{{ end }}" class="lazyload bio__photo"/>
{{ end }}
{{ end }}
</div>
2019-11-20 06:55:05 +00:00
<hr class="hr-slash bio-hr"/>
<div class="bio__name">
{{ .Site.Params.myname }}
</div>
<div class="bio__desc">
{{ .Site.Params.whoami }}
</div>
{{ if .Site.Params.organization }}
<div class="bio__info">
<div class="bio__info--icon">
{{ partial "svgs/etc/people.svg" (dict "width" 20 "height" 20) }}
</div>
{{ .Site.Params.organization }}
</div>
{{ end }}
{{ if .Site.Params.organization }}
<div class="bio__info">
<div class="bio__info--icon">
{{ partial "svgs/etc/location.svg" (dict "width" 20 "height" 20) }}
</div>
{{ .Site.Params.location }}
</div>
{{ end }}
{{ if .Site.Params.email }}
<div class="bio__info">
<div class="bio__info--icon">
{{ partial "svgs/social/email.svg" (dict "width" 20 "height" 20) }}
</div>
<a href="mailto:{{ .Site.Params.email }}">{{ .Site.Params.email }}</a>
</div>
{{ end }}
{{ if .Site.Params.link }}
<div class="bio__info">
<div class="bio__info--icon">
{{ partial "svgs/etc/link.svg" (dict "width" 20 "height" 20) }}
</div>
<a href="{{ .Site.Params.link }}" target="_blank" rel="noreferrer">{{ .Site.Params.link }}</a>
</div>
{{ end }}
<div class="bio__social">
{{ range $name, $path := $.Param "socialOptions" }}
{{ if (and $path (ne $name "email")) }}
<a href="{{ $path | safeURL }}" title="{{ $name }}" aria-label="{{ $name }}">
{{ partial (print "svgs/social/" $name ".svg") (dict "width" 25 "height" 25) }}
</a>
{{ end }}
{{ end }}
</div>
</div>
<hr class="hr-fade sidebar-hr"/>
{{ end }}