🐛 Fix: adapted to hugo v0.141.0 for try function

This commit is contained in:
Cell
2025-01-19 04:13:10 +08:00
parent 015610b7e8
commit cf04ad3593
7 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -25,7 +25,7 @@
> It is based on the original [LoveIt](https://github.com/dillonzq/LoveIt) Theme, [KeepIt](https://github.com/Fastbyte01/KeepIt) Theme and [LeaveIt](https://github.com/liuzc/LeaveIt) Theme.
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/hugo-fixit/FixIt?style=flat)](https://github.com/hugo-fixit/FixIt/releases)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.140.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.141.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/)
[![License](https://img.shields.io/github/license/hugo-fixit/FixIt?style=flat)](/LICENSE)
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/hugo-fixit/FixIt)
+1 -1
View File
@@ -25,7 +25,7 @@
> 它的原型基于 [LoveIt](https://github.com/dillonzq/LoveIt) 主题,[KeepIt](https://github.com/Fastbyte01/KeepIt) 主题和 [LeaveIt](https://github.com/liuzc/LeaveIt) 主题。
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/hugo-fixit/FixIt?style=flat)](https://github.com/hugo-fixit/FixIt/releases)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.140.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.141.0-ff4088?style=flat&logo=hugo)](https://gohugo.io/)
[![License](https://img.shields.io/github/license/hugo-fixit/FixIt?style=flat)](/LICENSE)
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/hugo-fixit/FixIt)
+1 -1
View File
@@ -135,7 +135,7 @@ enableEmoji = true
[module]
[module.hugoVersion]
extended = true
min = "0.140.0"
min = "0.141.0"
# -------------------------------------------------------------------------------------
# Markup related configuration in Hugo
@@ -6,17 +6,17 @@
{{- $pass := $suffixValid | or .Pass -}}
{{- if $pass -}}
{{- with $remoteResource := resources.GetRemote .Path -}}
{{- with try ($remoteResource := resources.GetRemote .Path) -}}
{{- with .Err -}}
{{- erroridf "error-get-remote-image" "%s" . -}}
{{- else -}}
{{- else with .Value -}}
{{- if eq $remoteResource.ResourceType "image" -}}
{{- /* placed remote image in public/images/remote/ */ -}}
{{- $resource = $remoteResource | resources.Copy (add "/images/remote/" $remoteResource.Name) -}}
{{- end -}}
{{- else -}}
{{- erroridf "error-get-remote-image" "Unable to get remote image %q" $.Path -}}
{{- end -}}
{{- else -}}
{{- erroridf "error-get-remote-image" "Unable to get remote image %q" .Path -}}
{{- end -}}
{{- end -}}
{{- return $resource -}}
@@ -1,12 +1,12 @@
{{- $response := dict -}}
{{- with resources.GetRemote .URL .OPTIONS -}}
{{- with try (resources.GetRemote .URL .OPTIONS) -}}
{{- with .Err -}}
{{- erroridf "error-get-remote-json" "%s" . -}}
{{- else -}}
{{- else with .Value -}}
{{- $response = .Content | transform.Unmarshal -}}
{{- else -}}
{{- erroridf "error-get-remote-json" "Unable to get remote resource %q" $.URL -}}
{{- end -}}
{{- else -}}
{{- erroridf "error-get-remote-json" "Unable to get remote resource %q" .URL -}}
{{- end -}}
{{- return $response -}}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- .Scratch.Set "version" "v0.3.17-07816709" -}}
{{- .Scratch.Set "version" "v0.3.17-015610b7" -}}
{{- .Scratch.Set "this" dict -}}
{{- partial "init/detection-env.html" . -}}
+1 -1
View File
@@ -7,7 +7,7 @@ licenselink = "https://github.com/hugo-fixit/FixIt/blob/master/LICENSE"
description = "A Clean, Elegant but Advanced Hugo Theme for Hugo."
homepage = "https://github.com/hugo-fixit/FixIt"
demosite = "https://fixit.lruihao.cn"
min_version = "0.140.0"
min_version = "0.141.0"
tags = [
"blog",