feat(author): support svg image

This commit is contained in:
ZhenShuo Leo
2025-11-26 17:46:53 +08:00
parent 34fc0e619f
commit afa810841c
5 changed files with 5 additions and 5 deletions

View File

@@ -10,7 +10,7 @@
{{ if $authorImage }}
{{ $final := $authorImage }}
{{ $squareImage := $authorImage }}
{{ if not $disableImageOptimization }}
{{ if not (or $disableImageOptimization (eq $authorImage.MediaType.SubType "svg")) }}
{{ $final = $authorImage.Fill "192x192" }}
{{ $shortSide := int (math.Min $authorImage.Width $authorImage.Height) }}
{{ $squareImage = $authorImage.Crop (printf "%dx%d" $shortSide $shortSide ) }}

View File

@@ -10,7 +10,7 @@
{{ if $authorImage }}
{{ $final := $authorImage }}
{{ $squareImage := $authorImage }}
{{ if not $disableImageOptimization }}
{{ if not (or $disableImageOptimization (eq $authorImage.MediaType.SubType "svg")) }}
{{ $final = $authorImage.Fill "192x192" }}
{{ $shortSide := int (math.Min $authorImage.Width $authorImage.Height) }}
{{ $squareImage = $authorImage.Crop (printf "%dx%d" $shortSide $shortSide ) }}

View File

@@ -52,7 +52,7 @@
{{ if $authorImage }}
{{ $final := $authorImage }}
{{ $squareImage := $authorImage }}
{{ if not $disableImageOptimization }}
{{ if not (or $disableImageOptimization (eq $authorImage.MediaType.SubType "svg")) }}
{{ $final = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
{{ $shortSide := int (math.Min $authorImage.Width $authorImage.Height) }}
{{ $squareImage = $authorImage.Crop (printf "%dx%d" $shortSide $shortSide ) }}

View File

@@ -55,7 +55,7 @@
{{ if $authorImage }}
{{ $final := $authorImage }}
{{ $squareImage := $authorImage }}
{{ if not $disableImageOptimization }}
{{ if not (or $disableImageOptimization (eq $authorImage.MediaType.SubType "svg")) }}
{{ $final = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
{{ $shortSide := int (math.Min $authorImage.Width $authorImage.Height) }}
{{ $squareImage = $authorImage.Crop (printf "%dx%d" $shortSide $shortSide ) }}

View File

@@ -14,7 +14,7 @@
{{ if $authorImage }}
{{ $final := $authorImage }}
{{ $squareImage := $authorImage }}
{{ if not $disableImageOptimization }}
{{ if not (or $disableImageOptimization (eq $authorImage.MediaType.SubType "svg")) }}
{{ $final = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
{{ $shortSide := int (math.Min $authorImage.Width $authorImage.Height) }}
{{ $squareImage = $authorImage.Crop (printf "%dx%d" $shortSide $shortSide ) }}