From 86e88935c734cccbfdba557565ceff4294e42d60 Mon Sep 17 00:00:00 2001 From: ZhenShuo Leo <98386542+ZhenShuo2021@users.noreply.github.com> Date: Mon, 14 Jul 2025 20:07:53 +0800 Subject: [PATCH] fix: support external image for author image on windows --- layouts/partials/author-extra.html | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/layouts/partials/author-extra.html b/layouts/partials/author-extra.html index 640222ad..78a93ee0 100644 --- a/layouts/partials/author-extra.html +++ b/layouts/partials/author-extra.html @@ -1,18 +1,13 @@ {{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
{{ with .data.image }} - {{ $authorImage := resources.Get . }} - {{ if $authorImage }} - {{ if not $disableImageOptimization }} - {{ $authorImage = $authorImage.Fill "192x192" }} - {{ end }} - + {{ $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 }}