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

76 lines
4.9 KiB
HTML
Raw Normal View History

2019-12-11 02:18:44 +00:00
{{ if $.Param "enableBio" }}
<section class="bio">
<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 }}" src="data:image/svg+xml,%0A%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='none' d='M0 0h24v24H0V0z'/%3E%3Cpath fill='%23aaa' d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-1 16H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h12c.55 0 1 .45 1 1v12c0 .55-.45 1-1 1zm-4.44-6.19l-2.35 3.02-1.56-1.88c-.2-.25-.58-.24-.78.01l-1.74 2.23c-.26.33-.02.81.39.81h8.98c.41 0 .65-.47.4-.8l-2.55-3.39c-.19-.26-.59-.26-.79 0z'/%3E%3C/svg%3E" class="lazyload bio__photo"/>
2019-12-11 02:18:44 +00:00
{{ 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 }}" src="data:image/svg+xml,%0A%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='none' d='M0 0h24v24H0V0z'/%3E%3Cpath fill='%23aaa' d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-1 16H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h12c.55 0 1 .45 1 1v12c0 .55-.45 1-1 1zm-4.44-6.19l-2.35 3.02-1.56-1.88c-.2-.25-.58-.24-.78.01l-1.74 2.23c-.26.33-.02.81.39.81h8.98c.41 0 .65-.47.4-.8l-2.55-3.39c-.19-.26-.59-.26-.79 0z'/%3E%3C/svg%3E" class="lazyload bio__photo"/>
2019-12-11 02:18:44 +00:00
{{ else if (fileExists "static/images/whoami/avatar.svg") }}
<img data-src="{{ "images/whoami/avatar.svg" | relURL }}" alt="{{ if .Site.Params.myname }}{{ .Site.Params.myname }}{{ else }}Avatar{{ end }}" src="data:image/svg+xml,%0A%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='none' d='M0 0h24v24H0V0z'/%3E%3Cpath fill='%23aaa' d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-1 16H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h12c.55 0 1 .45 1 1v12c0 .55-.45 1-1 1zm-4.44-6.19l-2.35 3.02-1.56-1.88c-.2-.25-.58-.24-.78.01l-1.74 2.23c-.26.33-.02.81.39.81h8.98c.41 0 .65-.47.4-.8l-2.55-3.39c-.19-.26-.59-.26-.79 0z'/%3E%3C/svg%3E" class="lazyload bio__photo"/>
2019-12-11 02:18:44 +00:00
{{ else }}
<img data-src="{{ "images/whoami/avatar.jpg" | relURL }}" alt="{{ if .Site.Params.myname }}{{ .Site.Params.myname }}{{ else }}Avatar{{ end }}" src="data:image/svg+xml,%0A%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='none' d='M0 0h24v24H0V0z'/%3E%3Cpath fill='%23aaa' d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-1 16H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h12c.55 0 1 .45 1 1v12c0 .55-.45 1-1 1zm-4.44-6.19l-2.35 3.02-1.56-1.88c-.2-.25-.58-.24-.78.01l-1.74 2.23c-.26.33-.02.81.39.81h8.98c.41 0 .65-.47.4-.8l-2.55-3.39c-.19-.26-.59-.26-.79 0z'/%3E%3C/svg%3E" class="lazyload bio__photo"/>
{{ end }}
2019-12-11 02:18:44 +00:00
{{ end }}
</div>
<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.location }}
<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>
</section>
<hr class="hr-fade sidebar-hr"/>
{{ end }}