LoveIt/layouts/partials/home/profile.html
2020-02-24 17:00:39 +08:00

36 lines
1.2 KiB
HTML

{{- $scratch := .Scratch.Get "scratch" -}}
<div class="home-profile">
{{- $avatar := .Site.Params.home.profile.avatarURL -}}
{{- with .Site.Params.home.profile.gravatarEmail -}}
{{- $avatar = md5 . | printf "https://www.gravatar.com/avatar/%s?s=240&d=mp" -}}
{{- end -}}
{{- with $avatar -}}
<div class="home-avatar">
<a href="/posts">
{{- partial "plugin/image.html" (dict "src-s" . "title" "avatar" "description" (T "home") "context" $) -}}
</a>
</div>
{{- end -}}
{{- with .Site.Params.home.profile.subtitle -}}
<h2 class="home-description">
{{- if $.Site.Params.home.profile.typeit -}}
{{- $id := md5 . | printf "tp-%s" -}}
<div id={{ printf "r%s" $id }} hidden=true>
{{- . -}}
</div>
<div id={{ $id }} class="typeit"></div>
{{- $scratch.SetInMap "typeitMap" $id (slice $id) -}}
{{- else -}}
{{- . -}}
{{- end -}}
</h2>
{{- end -}}
<div class="home-social-links">
{{- if .Site.Params.home.profile.social -}}
{{- partial "plugin/social.html" . -}}
{{- end -}}
</div>
</div>