From 0978234bf6aa03d74c5ec6c3d56ba42051abf484 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Tue, 23 Dec 2025 14:34:57 +0800 Subject: [PATCH] fix: update image processing configurations for improved performance and quality --- hugo.toml | 18 ++++++++++-------- layouts/_markup/render-image.html | 6 +++--- layouts/_partials/home/profile.html | 6 +++--- layouts/_partials/init/index.html | 2 +- layouts/_partials/single/post-author.html | 6 +++--- layouts/posts/single.html | 8 ++++---- layouts/summary.html | 6 +++--- 7 files changed, 27 insertions(+), 25 deletions(-) diff --git a/hugo.toml b/hugo.toml index 40964bd7..8dd4d18c 100644 --- a/hugo.toml +++ b/hugo.toml @@ -37,6 +37,15 @@ enableEmoji = true # otherwise it returns the section with the most pages. # mainSections = ["posts"] +# ------------------------------------------------------------------------------------- +# Imaging Configuration +# See: https://gohugo.io/configuration/imaging/ +# ------------------------------------------------------------------------------------- + +[imaging] +_merge = "shallow" +quality = 75 + # ------------------------------------------------------------------------------------- # Menu Configuration # See: https://fixit.lruihao.cn/documentation/basics/#menu-configuration @@ -1083,6 +1092,7 @@ feedId = "" userId = "" # FixIt 0.3.17 | NEW Image config +# Combined with Hugo's image processing option `imaging` for image optimisation [params.image] # cache remote images for better optimisations cacheRemote = false @@ -1343,14 +1353,6 @@ scale = true # whether to add FullscreenControl fullscreen = true -# FixIt 0.3.0 | NEW [Experimental] cache remote images locally -# See: https://github.com/hugo-fixit/FixIt/pull/362 -# TODO remove (works on image-legacy.html) -[params.page.cacheRemoteImages] -enable = false -# replace remote image URL with local image URL (place in public/images/remote/) -replace = false - # FixIt 0.3.0 | NEW Related content config (https://gohugo.io/content-management/related/) [params.page.related] enable = false diff --git a/layouts/_markup/render-image.html b/layouts/_markup/render-image.html index a2a9ca7c..63a4663b 100644 --- a/layouts/_markup/render-image.html +++ b/layouts/_markup/render-image.html @@ -9,9 +9,9 @@ A Markdown image has three components: the image description, the image destinat */ -}} {{- $params := .Page.Params | merge site.Params.page -}} {{- $optim := slice - (dict "Process" "resize 800x webp q75" "descriptor" "800w") - (dict "Process" "resize 1200x webp q75" "descriptor" "1200w") - (dict "Process" "resize 1600x webp q75" "descriptor" "1600w") + (dict "Process" "resize 800x webp" "descriptor" "800w") + (dict "Process" "resize 1200x webp" "descriptor" "1200w") + (dict "Process" "resize 1600x webp" "descriptor" "1600w") -}} {{- if .Title -}} {{- $linked := ne $params.lightgallery false -}} diff --git a/layouts/_partials/home/profile.html b/layouts/_partials/home/profile.html index 832c8a8a..47d87b3f 100644 --- a/layouts/_partials/home/profile.html +++ b/layouts/_partials/home/profile.html @@ -7,9 +7,9 @@