Merge pull request #2336 from ZhenShuo2021/fix/windows-author-image

🐛 Fix: author image does not support external URL on Windows
This commit is contained in:
Nuno C.
2025-07-21 10:07:51 +01:00
committed by GitHub

View File

@@ -1,18 +1,13 @@
{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
<div class="flex author author-extra mt-4">
{{ with .data.image }}
{{ $authorImage := resources.Get . }}
{{ if $authorImage }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "192x192" }}
{{ end }}
<img
class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4"
width="96"
height="96"
src="{{ $authorImage.RelPermalink }}">
{{ $authorImage := "" }}
{{ if or (hasPrefix . "http://") (hasPrefix . "https://") }}
{{ $authorImage = resources.GetRemote . }}
{{ else }}
{{ $authorImage := resources.GetRemote . }}
{{ $authorImage = resources.Get . }}
{{ end }}
{{ if $authorImage }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "192x192" }}
{{ end }}