Skip to content

Commit

Permalink
🐛 Fix: featuredimagepreview error in summary and RSS
Browse files Browse the repository at this point in the history
  • Loading branch information
Lruihao committed Aug 29, 2024
1 parent 312b636 commit 349de54
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
6 changes: 0 additions & 6 deletions layouts/_default/summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
11 changes: 6 additions & 5 deletions layouts/partials/feed/rss.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/init/index.html
Original file line number Diff line number Diff line change
@@ -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" . -}}
Expand Down

0 comments on commit 349de54

Please sign in to comment.