diff --git a/layouts/partials/index_profile.html b/layouts/partials/index_profile.html index 3851e715..1bb2079f 100644 --- a/layouts/partials/index_profile.html +++ b/layouts/partials/index_profile.html @@ -2,9 +2,31 @@ {{- with site.Params.profileMode }}
{{- if .imageUrl -}} + {{- $img := resources.Get .imageUrl }} + {{- if $img }} + {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}} + {{- if hugo.IsExtended -}} + {{- $processableFormats = $processableFormats | append "webp" -}} + {{- end -}} + {{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }} + {{- if and (in $processableFormats $img.MediaType.SubType) (eq $prod true)}} + {{- if (not (and (not .imageHeight) (not .imageWidth))) }} + {{- $img = $img.Resize (printf "%dx%d" .imageWidth .imageHeight) }} + {{- else if .imageHeight }} + {{- $img = $img.Resize (printf "x%d" .imageHeight) }} + {{ else if .imageWidth }} + {{- $img = $img.Resize (printf "%dx" .imageWidth) }} + {{ else }} + {{- $img = $img.Resize "150x150" }} + {{- end }} + {{- end }} + {{ .imageTitle | default + {{- else }} {{ .imageTitle | default {{- end }} + {{- end }}

{{ .title | default site.Title | markdownify }}

{{ .subtitle | markdownify }} {{- partial "social_icons.html" site.Params.socialIcons -}} @@ -20,4 +42,4 @@ {{- end }}
{{- end}} - + \ No newline at end of file