🐛 Fix: featuredimagepreview error in summary and RSS

This commit is contained in:
Cell
2024-08-29 14:05:40 +08:00
parent 312b6363dc
commit 349de54009
3 changed files with 7 additions and 12 deletions
-6
View File
@@ -3,12 +3,6 @@
<article class="single summary" itemscope itemtype="http://schema.org/Article">
{{- /* Featured image */ -}}
{{- $image := $params.featuredimagepreview | default $params.featuredimage -}}
{{- with $image }}
{{- if not (hasPrefix . "/") }}
{{- $image = (printf "%s%s" $.RelPermalink .) | safeURL }}
{{- end }}
{{- $image = $image | relURL }}
{{- end }}
{{- with .Resources.GetMatch "featured-image" -}}
{{- $image = .RelPermalink -}}
{{- end -}}
+6 -5
View File
@@ -26,14 +26,15 @@
{{- end }}
{{- range $page := $pages }}
{{- $params := .Params | merge .Site.Params.Page }}
{{- $fullText := ((.Params.feed | default dict) | merge $.Config ).fullText }}
{{- $fullText := ((.Params.feed | default dict) | merge $.Config ).fulltext }}
{{- $author := partial "function/get-author-map.html" .Params.author }}
{{- $cacheRemoteImages := $params.cacheRemoteImages }}
{{- $image := $params.featuredimagepreview | default $params.featuredimage }}
{{- with $image }}
{{- if not (hasPrefix . "/") }}
{{- $image = (printf "%s%s" $page.RelPermalink .) | safeURL }}
{{- with dict "Path" $image "Resources" .Resources "CacheRemoteImages" $cacheRemoteImages.enable | partial "function/resource.html" }}
{{- $url := urls.Parse $image }}
{{- if not $url.Host | or $cacheRemoteImages.replace }}
{{- $image = .Permalink }}
{{- end }}
{{- $image = $image | absURL }}
{{- end }}
{{- with .Resources.GetMatch "featured-image" }}
{{- $image = .Permalink }}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- .Scratch.Set "version" "v0.3.10-18643271" -}}
{{- .Scratch.Set "version" "v0.3.10-312b6363" -}}
{{- .Scratch.Set "this" dict -}}
{{- partial "init/detection-env.html" . -}}