diff --git a/layouts/partials/function/get-remote-image.html b/layouts/partials/function/get-remote-image.html index 9881f76a..22b01e1f 100644 --- a/layouts/partials/function/get-remote-image.html +++ b/layouts/partials/function/get-remote-image.html @@ -7,15 +7,16 @@ {{- if $pass -}} {{- with $remoteResource := resources.GetRemote .Path -}} - {{ printf "Remote image: %v" $remoteResource.ResourceType -}} {{- with .Err -}} - {{- warnf "%s" . -}} - {{ else }} + {{- erroridf "error-get-remote-image" "%s" . -}} + {{- else -}} {{- if eq $remoteResource.ResourceType "image" -}} {{- /* placed remote image in public/images/remote/ */ -}} {{- $resource = $remoteResource | resources.Copy (add "/images/remote/" $remoteResource.Name) -}} {{- end -}} {{- end -}} + {{- else -}} + {{- erroridf "error-get-remote-image" "Unable to get remote image %q" .Path -}} {{- end -}} {{- end -}} {{- return $resource -}} diff --git a/layouts/partials/init/detection-deprecated.html b/layouts/partials/init/detection-deprecated.html index cb24098c..9035d078 100644 --- a/layouts/partials/init/detection-deprecated.html +++ b/layouts/partials/init/detection-deprecated.html @@ -2,20 +2,6 @@ {{- $warns := slice -}} {{- $errors := slice -}} -{{- with .Site.Params.home.profile.gravatarSite -}} - {{- $warns = $warns | append "The parameter `home.profile.gravatarSite` is deprecated since v0.2.14, use `gravatar.host` instead." -}} -{{- end -}} -{{- with .Site.Params.ibruce.siteTime -}} - {{- $warns = $warns | append "The parameter `ibruce.siteTime` is deprecated since v0.2.14, use `footer.siteTime` instead." -}} -{{- end -}} -{{- with .Site.Params.autoBookmark -}} - {{- $warns = $warns | append "The parameter `autoBookmark` is deprecated since v0.2.17, use `page.autoBookmark` instead." -}} -{{- end -}} -{{- with .Site.Params.footer.siteTime -}} - {{- if not (reflect.IsMap .) -}} - {{- $warns = $warns | append "The parameter `footer.siteTime` has changed to a Map since v0.2.17. Please correct the format!" -}} - {{- end -}} -{{- end -}} {{- with .Site.Params.gitRepo | or .Site.Params.page.edit -}} {{- $warns = $warns | append "The parameter `params.gitRepo` and `params.page.edit` is deprecated since v0.3.0, use `params.gitInfo` instead." -}} {{- end -}} diff --git a/layouts/partials/plugin/link.html b/layouts/partials/plugin/link.html index 02857fb2..86186ade 100644 --- a/layouts/partials/plugin/link.html +++ b/layouts/partials/plugin/link.html @@ -42,10 +42,12 @@ {{- end -}} {{- else -}} {{- $cardIcon := .CardIcon -}} - {{- if $url.Host | and (eq $cardIcon "") -}} + {{- if $url.Host | and (eq .CardIcon true) -}} + {{- $cardIcon = false -}} + {{- /* 中国大陆地区无法使用,如果你有更好的 API 或者方案,欢迎 PR! */ -}} {{- $favicon := partial "function/get-remote-image.html" (dict "Path" (add "https://www.google.com/s2/favicons?sz=64&domain=" $url.Host) "Pass" true) -}} - {{- if $favicon -}} - {{- $cardIcon = $favicon.RelPermalink -}} + {{- with $favicon -}} + {{- $cardIcon = .RelPermalink -}} {{- end -}} {{- end -}}