hugo-theme-zzo/layouts/partials/body/whoami.html

44 lines
2.0 KiB
HTML

{{ if $.Param "enableWhoami" }}
<div class="whoami__gutter"></div>
<hr class="hr-slash whoami-hr"/>
<div class="whoami">
<div class="whoami__image-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="whoami__image"/>
{{ else }}
{{ if (fileExists "static/images/whoami/avatar.png") }}
<img src="{{ "images/whoami/avatar.png" | relURL }}" alt="{{ if .Site.Params.myname }}{{ .Site.Params.myname }}{{ else }}Avatar{{ end }}" class="whoami__image"/>
{{ else if (fileExists "static/images/whoami/avatar.jpg") }}
<img src="{{ "images/whoami/avatar.jpg" | relURL }}" alt="{{ if .Site.Params.myname }}{{ .Site.Params.myname }}{{ else }}Avatar{{ end }}" class="whoami__image"/>
{{ else if (fileExists "static/images/whoami/avatar.svg") }}
<img src="{{ "images/whoami/avatar.svg" | relURL }}" alt="{{ if .Site.Params.myname }}{{ .Site.Params.myname }}{{ else }}Avatar{{ end }}" class="whoami__image"/>
{{ else }}
<img src="{{ "images/whoami/avatar.jpg" | relURL }}" alt="{{ if .Site.Params.myname }}{{ .Site.Params.myname }}{{ else }}Avatar{{ end }}" class="whoami__image"/>
{{ end }}
{{ end }}
</div>
<div class="whoami__contents">
<div class="whoami__written-by">
{{ T "single-writtenBy" }}
</div>
<div class="whoami__title">
{{ .Site.Params.myname }}
</div>
<div class="whoami__desc">
{{ .Site.Params.whoami }}
</div>
<div class="whoami__social">
{{ range $name, $path := $.Param "socialOptions" }}
{{ if $path }}
<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>
</div>
<hr class="hr-slash whoami-hr" />
{{ end }}