mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-27 12:03:49 +01:00
fix(search): wrong permalink to page (#93)
- Show external image closes https://github.com/CaiJimmy/hugo-theme-stack/issues/92
This commit is contained in:
parent
80be1b2435
commit
a5820c6f52
1 changed files with 8 additions and 6 deletions
|
@ -8,15 +8,17 @@
|
||||||
{{- $data := dict "title" .Title "date" .Date "permalink" .Permalink "content" (.Plain) -}}
|
{{- $data := dict "title" .Title "date" .Date "permalink" .Permalink "content" (.Plain) -}}
|
||||||
|
|
||||||
{{- $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink "articleList" -}}
|
{{- $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink "articleList" -}}
|
||||||
{{- if and $image.exists $image.resource -}}
|
{{- if $image.exists -}}
|
||||||
{{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
|
{{- $imagePermalink := "" -}}
|
||||||
|
{{- if and $image.resource (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
|
||||||
{{- $thumbnail := $image.resource.Fill "120x120" -}}
|
{{- $thumbnail := $image.resource.Fill "120x120" -}}
|
||||||
{{- $image := dict "image" (absURL $thumbnail.Permalink) -}}
|
{{- $imagePermalink = (absURL $thumbnail.Permalink) -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $image := dict "image" (absURL $image.resource.Permalink) -}}
|
{{- $imagePermalink = $image.permalink -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $data = merge $data $image -}}
|
|
||||||
{{ end }}
|
{{- $data = merge $data (dict "image" (absURL $imagePermalink)) -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{- $result = $result | append $data -}}
|
{{- $result = $result | append $data -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
Loading…
Reference in a new issue