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:
Jimmy Cai
2020-12-23 21:02:35 +01:00
committed by GitHub
parent 64e06f0beb
commit 2ad65a4c07
8 changed files with 104 additions and 51 deletions
+6 -2
View File
@@ -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 }}