feat: add option to disable image processing (#83)
* feat: add option to disable image processing closes https://github.com/CaiJimmy/hugo-theme-stack/issues/37 * refactor(list): use article/components/header inside default.html * refactor: use .Fill for cover image
This commit is contained in:
@@ -9,8 +9,12 @@
|
||||
|
||||
{{- $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink "articleList" -}}
|
||||
{{- if and $image.exists $image.resource -}}
|
||||
{{- $thumbnail := $image.resource.Fill "120x120" -}}
|
||||
{{- $image := dict "image" (absURL $thumbnail.Permalink) -}}
|
||||
{{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
|
||||
{{- $thumbnail := $image.resource.Fill "120x120" -}}
|
||||
{{- $image := dict "image" (absURL $thumbnail.Permalink) -}}
|
||||
{{- else -}}
|
||||
{{- $image := dict "image" (absURL $image.resource.Permalink) -}}
|
||||
{{- end -}}
|
||||
{{- $data = merge $data $image -}}
|
||||
{{ end }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user