From dfa18cd87339d5a739b2d92d0d7684033c8fd89f Mon Sep 17 00:00:00 2001 From: PCloud Date: Thu, 23 May 2024 11:11:39 +0100 Subject: [PATCH] refactor: profile --- layouts/partials/home/profile.html | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/layouts/partials/home/profile.html b/layouts/partials/home/profile.html index ecd0f6c64..ad7cfe0f8 100644 --- a/layouts/partials/home/profile.html +++ b/layouts/partials/home/profile.html @@ -7,20 +7,24 @@ {{- if $avatar -}}
{{- $menus := $.Site.Menus.main | default slice -}} + {{- $optim := slice + (dict "Process" "fill center 96x96 webp q75" "descriptor" "800w") + (dict "Process" "fill center 144x144 webp q75" "descriptor" "1200w") + (dict "Process" "fill center 192x192 webp q75" "descriptor" "1600w") + -}} {{- with index $menus 0 -}} - {{- $url := .URL | relLangURL -}} - {{- with .Page -}} - {{- $url = .RelPermalink -}} - {{- end -}} - {{- with $profile.avatarLinkURL -}} - {{- $url = . -}} - {{- end -}} - - {{- dict "Src" $avatar "Height" "100" "Width" "100" "Loading" "eager" | partial "plugin/image.html" -}} - + {{- $url := .URL | relLangURL -}} + {{- with .Page -}} + {{- $url = .RelPermalink -}} + {{- end -}} + {{- with $profile.avatarLinkURL -}} + {{- $url = . -}} + {{- end -}} + + {{- dict "Src" $avatar "Height" "100" "Width" "100" "Loading" "eager" "Optim" $optim | partial "plugin/image.html" -}} + {{- else -}} - {{- dict "Src" $avatar "Height" "100" "Width" "100" | partial "plugin/image.html" -}} + {{- dict "Src" $avatar "Height" "100" "Width" "100" "Loading" "eager" "Optim" $optim | partial "plugin/image.html" -}} {{- end -}}
{{- end -}}