From de5fd0c3f727c51012a2ad06c56f8828db39be3f Mon Sep 17 00:00:00 2001
From: Cell <1024@lruihao.cn>
Date: Sat, 30 Dec 2023 23:18:15 +0800
Subject: [PATCH] :truck: Feat: migarte params.cacheRemoteImages to
params.page.cacheRemoteImages (#362)
---
docs | 2 +-
hugo.toml | 20 +++++++++-----------
layouts/_default/_markup/render-image.html | 4 ++--
layouts/friends/single.html | 2 +-
layouts/page/friends.html | 2 +-
layouts/partials/plugin/image.html | 3 ++-
layouts/shortcodes/image.html | 2 +-
7 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/docs b/docs
index ec2bbf0e..fda1a078 160000
--- a/docs
+++ b/docs
@@ -1 +1 @@
-Subproject commit ec2bbf0e755d0d23dd0bde97286bc455f83d8a5a
+Subproject commit fda1a078d3e15d3193f7a35acebfab5aaf9e54ca
diff --git a/hugo.toml b/hugo.toml
index 1e7f789b..8bf98e11 100644
--- a/hugo.toml
+++ b/hugo.toml
@@ -717,6 +717,15 @@ enableEmoji = true
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
+ [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
+ count = 5
# FixIt 0.2.17 | NEW Donate (Sponsor) settings
[params.page.reward]
enable = false
@@ -916,11 +925,6 @@ enableEmoji = true
name = ""
logoUrl = ""
- # FixIt 0.3.0 | NEW Related content config (https://gohugo.io/content-management/related/)
- [params.page.related]
- enable = false
- count = 5
-
# TypeIt config
[params.typeit]
# typing speed between each step (measured in milliseconds)
@@ -1073,12 +1077,6 @@ enableEmoji = true
# "corner-indicator", "fill-left", "flash", "flat-top", "loading-bar", "mac-osx", "material", "minimal"]
theme = "minimal"
- # FixIt 0.3.0 | NEW [Experimental] cache remote images locally, see: https://github.com/hugo-fixit/FixIt/pull/362
- [params.cacheRemoteImages]
- enable = false
- # replace remote image url with local image url
- replace = false
-
# FixIt 0.2.17 | NEW Define custom file paths
# Create your custom files in site directory `layouts/partials/custom` and uncomment needed files below
[params.customFilePath]
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html
index 2aa4d0a9..68cc9f92 100644
--- a/layouts/_default/_markup/render-image.html
+++ b/layouts/_default/_markup/render-image.html
@@ -1,11 +1,11 @@
{{- if .Title | and .Text -}}
- {{- dict "Src" .Destination "Alt" .Text "Caption" .Text "Title" .Title "Linked" true "Resources" .Page.Resources "Params" .Page.Params "Responsive" true | partial "plugin/image.html" -}}
+ {{- dict "Src" .Destination "Alt" .Text "Caption" .Text "Title" .Title "Linked" true "Resources" .Page.Resources "Responsive" true | partial "plugin/image.html" -}}
{{- .Text | safeHTML -}}
{{- else -}}
{{- $linked := (eq (.Page.Scratch.Get "params").lightgallery "force") | or (ne .Title "") -}}
- {{- dict "Src" .Destination "Alt" .Text "Title" .Title "Linked" $linked "Resources" .Page.Resources "Params" .Page.Params "Responsive" true | partial "plugin/image.html" -}}
+ {{- dict "Src" .Destination "Alt" .Text "Title" .Title "Linked" $linked "Resources" .Page.Resources "Responsive" true | partial "plugin/image.html" -}}
{{- end -}}
diff --git a/layouts/friends/single.html b/layouts/friends/single.html
index 4ce85a20..dcd80dc7 100644
--- a/layouts/friends/single.html
+++ b/layouts/friends/single.html
@@ -22,7 +22,7 @@
{{ range $index, $friend := .Site.Data.friends }}
{{ if $friend.avatar }}
- {{- dict "Src" $friend.avatar "Alt" $friend.nickname "Class" "friend-avatar" "Resources" $.Resources "Params" $.Params | partial "plugin/image.html" -}}
+ {{- dict "Src" $friend.avatar "Alt" $friend.nickname "Class" "friend-avatar" "Resources" $.Resources | partial "plugin/image.html" -}}
{{ else }}