Fix error with profileMode imageUrl on Windows devices

when imageUrl was set with external link resources.Get throws an error

Ref: 22ef5da20d

fixes: #1019
This commit is contained in:
Aditya Telange 2022-09-03 16:06:39 +05:30
parent 1f0f294c85
commit ddfea82cc7
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77

View File

@ -2,7 +2,10 @@
{{- with site.Params.profileMode }} {{- with site.Params.profileMode }}
<div class="profile_inner"> <div class="profile_inner">
{{- if .imageUrl -}} {{- if .imageUrl -}}
{{- $img := resources.Get .imageUrl }} {{- $img := "" }}
{{- if not (urls.Parse .imageUrl).IsAbs }}
{{- $img = resources.Get .imageUrl }}
{{- end }}
{{- if $img }} {{- if $img }}
{{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}} {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}}
{{- if hugo.IsExtended -}} {{- if hugo.IsExtended -}}