diff --git a/README.md b/README.md index b56804af..34415554 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/README.zh-cn.md b/README.zh-cn.md index 83e4e60e..820c0ad3 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -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) diff --git a/hugo.toml b/hugo.toml index 06df9b90..286e6eed 100644 --- a/hugo.toml +++ b/hugo.toml @@ -135,7 +135,7 @@ enableEmoji = true [module] [module.hugoVersion] extended = true - min = "0.140.0" + min = "0.141.0" # ------------------------------------------------------------------------------------- # Markup related configuration in Hugo diff --git a/layouts/partials/function/get-remote-image.html b/layouts/partials/function/get-remote-image.html index 22b01e1f..dbb35508 100644 --- a/layouts/partials/function/get-remote-image.html +++ b/layouts/partials/function/get-remote-image.html @@ -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 -}} diff --git a/layouts/partials/function/get-remote-json.html b/layouts/partials/function/get-remote-json.html index 52c696e8..0f7deb7d 100644 --- a/layouts/partials/function/get-remote-json.html +++ b/layouts/partials/function/get-remote-json.html @@ -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 -}} diff --git a/layouts/partials/init/index.html b/layouts/partials/init/index.html index e9d158fc..1f33ffbb 100644 --- a/layouts/partials/init/index.html +++ b/layouts/partials/init/index.html @@ -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" . -}} diff --git a/theme.toml b/theme.toml index 7a22fe49..a6f55430 100644 --- a/theme.toml +++ b/theme.toml @@ -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",