fix: support external image for author image on windows

This commit is contained in:
ZhenShuo Leo
2025-07-14 20:07:53 +08:00
parent 2c71bda97f
commit 86e88935c7

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 }}