mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
🐛 Fix: adapted to hugo v0.141.0 for try function
This commit is contained in:
@@ -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.
|
||||
|
||||
[](https://github.com/hugo-fixit/FixIt/releases)
|
||||
[](https://gohugo.io/)
|
||||
[](https://gohugo.io/)
|
||||
[](/LICENSE)
|
||||
[](https://github.com/hugo-fixit/FixIt)
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
> 它的原型基于 [LoveIt](https://github.com/dillonzq/LoveIt) 主题,[KeepIt](https://github.com/Fastbyte01/KeepIt) 主题和 [LeaveIt](https://github.com/liuzc/LeaveIt) 主题。
|
||||
|
||||
[](https://github.com/hugo-fixit/FixIt/releases)
|
||||
[](https://gohugo.io/)
|
||||
[](https://gohugo.io/)
|
||||
[](/LICENSE)
|
||||
[](https://github.com/hugo-fixit/FixIt)
|
||||
|
||||
|
||||
@@ -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,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
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user