{{- $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 -}}
{{- end -}}
{{- with .Site.Params.home.profile.subtitle -}}
{{- if $.Site.Params.home.profile.typeit -}}
{{- $id := partial "function/id.html" (dict "content" . "scratch" $.Scratch) -}}
{{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
{{- else -}}
{{- . -}}
{{- end -}}
{{- end -}}
{{- if .Site.Params.home.profile.social -}}
{{- $socialMap := resources.Get "data/social.yaml" | transform.Unmarshal -}}
{{- $socialArr := slice -}}
{{- range $key, $value := .Site.Params.social -}}
{{- $social := $key | lower | index $socialMap | default dict -}}
{{- if $value -}}
{{- if reflect.IsMap $value -}}
{{- $social = $value | merge $social -}}
{{- else if ne $value true -}}
{{- $social = dict "id" $value | merge $social -}}
{{- end -}}
{{- if $social.icon.simpleicons -}}
{{- $prefix := ($.Scratch.Get "cdn" | default dict).simpleIconsPrefix -}}
{{- $social = dict "prefix" $prefix | dict "icon" | merge $social -}}
{{- end -}}
{{- $socialArr = $socialArr | append $social -}}
{{- end -}}
{{- end -}}
{{- range sort $socialArr "weight" -}}
{{- partial "plugin/social.html" . -}}
{{- end -}}
{{- end -}}
{{- with .Site.Params.home.profile.disclaimer -}}
{{- . | safeHTML -}}
{{- end -}}