Skip to content

Commit

Permalink
fix: use _funcs/get-page-images for getting thumbnail images
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Mar 8, 2024
1 parent 65fdf3f commit 742fc49
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.

This file was deleted.

19 changes: 8 additions & 11 deletions layouts/partials/images/functions/page-thumbnail.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
{{- $img := "" }}
{{- $page := .Page }}
{{- with $page.Params.images }}
{{- $img = index . 0 }}
{{- else }}
{{- $thumbnail := partialCached "images/functions/page-thumbnail-resource" $page $page }}
{{- with $thumbnail }}
{{- $img = replace .RelPermalink $page.RelPermalink "" | printf "%s?height=360px" }}
{{- end }}
{{- end }}
{{- $images := partial "_funcs/get-page-images" $page }}
{{- $html := "" }}
{{- with $img }}
{{- with $images }}
{{- $image := index . 0 }}
{{- $filename := $image.RelPermalink }}
{{- if $image.Image }}
{{- $filename = $image.Image.Name }}
{{- end }}
{{- $html = partial "images/image" (dict
"Filename" $img
"Filename" $filename
"Page" $page
"Style" $.Style
"ClassName" $.ClassName)
Expand Down

0 comments on commit 742fc49

Please sign in to comment.