2020-05-04 10:43:47 +02:00
|
|
|
{{- $profile := .Site.Params.home.profile -}}
|
2020-02-13 18:30:33 +01:00
|
|
|
<div class="home-profile">
|
2020-05-04 10:43:47 +02:00
|
|
|
{{- $avatar := $profile.avatarURL -}}
|
|
|
|
{{- with $profile.gravatarEmail -}}
|
2020-05-18 10:10:24 +02:00
|
|
|
{{- $avatar = md5 . | printf "https://www.gravatar.com/avatar/%v?s=240&d=mp" -}}
|
2020-01-31 15:53:04 +01:00
|
|
|
{{- end -}}
|
2020-05-04 09:24:40 +02:00
|
|
|
{{- if $avatar -}}
|
2019-08-24 13:32:41 +02:00
|
|
|
<div class="home-avatar">
|
2020-05-04 10:43:47 +02:00
|
|
|
{{- $menus := $.Site.Menus.main | default slice -}}
|
|
|
|
{{- with index $menus 0 -}}
|
|
|
|
{{- $url := .URL | relLangURL -}}
|
|
|
|
{{- with .Page -}}
|
|
|
|
{{- $url = .RelPermalink -}}
|
2020-05-04 09:24:40 +02:00
|
|
|
{{- end -}}
|
2020-05-04 10:43:47 +02:00
|
|
|
<a href="{{ $url }}"{{ with .Title | default .Name }} title="{{ . }}"{{ end }}{{ if (urls.Parse $url).Host }} rel="noopener noreffer" target="_blank"{{ end }}>
|
2020-05-28 11:05:37 +02:00
|
|
|
{{- dict "Src" $avatar | partial "plugin/image.html" -}}
|
2020-05-04 09:24:40 +02:00
|
|
|
</a>
|
|
|
|
{{- else -}}
|
2020-05-28 11:05:37 +02:00
|
|
|
{{- dict "Src" $avatar | partial "plugin/image.html" -}}
|
2020-05-04 09:24:40 +02:00
|
|
|
{{- end -}}
|
2019-08-10 21:26:03 +02:00
|
|
|
</div>
|
2020-01-31 15:53:04 +01:00
|
|
|
{{- end -}}
|
2019-08-10 21:26:03 +02:00
|
|
|
|
2020-05-04 10:43:47 +02:00
|
|
|
{{- with $profile.title -}}
|
|
|
|
<h1 class="home-title">
|
2020-05-13 15:33:30 +02:00
|
|
|
{{- . | safeHTML -}}
|
2020-05-04 10:43:47 +02:00
|
|
|
</h1>
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- with $profile.subtitle -}}
|
2020-11-28 02:53:51 +01:00
|
|
|
<div class="home-subtitle">
|
2020-05-04 10:43:47 +02:00
|
|
|
{{- if $profile.typeit -}}
|
2020-05-18 15:30:33 +02:00
|
|
|
{{- $id := dict "Content" . "Scratch" $.Scratch | partial "function/id.html" -}}
|
2020-02-27 13:14:40 +01:00
|
|
|
<div id="{{ $id }}" class="typeit"></div>
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
|
2020-01-31 15:53:04 +01:00
|
|
|
{{- else -}}
|
2020-02-24 10:00:39 +01:00
|
|
|
{{- . -}}
|
2020-01-31 15:53:04 +01:00
|
|
|
{{- end -}}
|
2020-11-28 02:53:51 +01:00
|
|
|
</div>
|
2020-01-31 15:53:04 +01:00
|
|
|
{{- end -}}
|
2019-08-10 21:26:03 +02:00
|
|
|
|
2020-05-04 10:43:47 +02:00
|
|
|
{{- if $profile.social -}}
|
2020-05-13 13:35:46 +02:00
|
|
|
<div class="links">
|
2020-05-06 17:11:34 +02:00
|
|
|
{{- $socialMap := resources.Get "data/social.yml" | transform.Unmarshal -}}
|
2020-04-24 13:04:37 +02:00
|
|
|
{{- $socialArr := slice -}}
|
|
|
|
{{- range $key, $value := .Site.Params.social -}}
|
|
|
|
{{- $social := $key | lower | index $socialMap | default dict -}}
|
|
|
|
{{- if $value -}}
|
|
|
|
{{- if reflect.IsMap $value -}}
|
2020-05-28 11:05:37 +02:00
|
|
|
{{- with $value.weight -}}
|
|
|
|
{{- $social = dict "Weight" . | merge $social -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- with $value.prefix -}}
|
|
|
|
{{- $social = dict "Prefix" . | merge $social -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- with $value.template -}}
|
|
|
|
{{- $social = dict "Template" . | merge $social -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- with $value.id -}}
|
|
|
|
{{- $social = dict "Id" . | merge $social -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- with $value.url -}}
|
|
|
|
{{- $social = dict "Url" . | merge $social -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- with $value.title -}}
|
|
|
|
{{- $social = dict "Title" . | merge $social -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- with $value.newtab -}}
|
|
|
|
{{- $social = dict "Newtab" . | merge $social -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- with $value.icon -}}
|
|
|
|
{{- $social = dict "Icon" . | merge $social -}}
|
|
|
|
{{- end -}}
|
2020-04-24 13:04:37 +02:00
|
|
|
{{- else if ne $value true -}}
|
2020-05-28 11:05:37 +02:00
|
|
|
{{- $social = dict "Id" $value | merge $social -}}
|
2020-04-24 13:04:37 +02:00
|
|
|
{{- end -}}
|
2020-05-28 11:05:37 +02:00
|
|
|
{{- if $social.Icon.Simpleicons -}}
|
2020-04-24 13:04:37 +02:00
|
|
|
{{- $prefix := ($.Scratch.Get "cdn" | default dict).simpleIconsPrefix -}}
|
2020-05-28 11:05:37 +02:00
|
|
|
{{- $social = dict "Prefix" $prefix | dict "Icon" | merge $social -}}
|
2020-04-24 13:04:37 +02:00
|
|
|
{{- end -}}
|
|
|
|
{{- $socialArr = $socialArr | append $social -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
2020-05-28 11:05:37 +02:00
|
|
|
{{- range sort $socialArr "Weight" -}}
|
2020-04-24 13:04:37 +02:00
|
|
|
{{- partial "plugin/social.html" . -}}
|
|
|
|
{{- end -}}
|
|
|
|
</div>
|
2020-03-16 18:03:08 +01:00
|
|
|
{{- end -}}
|
|
|
|
|
2020-05-04 10:43:47 +02:00
|
|
|
{{- with $profile.disclaimer -}}
|
2020-03-16 18:03:08 +01:00
|
|
|
<h3 class="home-disclaimer">
|
|
|
|
{{- . | safeHTML -}}
|
|
|
|
</h3>
|
|
|
|
{{- end -}}
|
2019-08-10 21:26:03 +02:00
|
|
|
</div>
|